setuptools

Symbol not found: __PyCodecInfo_GetIncrementalDecoder

倾然丶 夕夏残阳落幕 提交于 2019-11-26 10:33:45
问题 Since updating from Homebrew Python 2.7.11 (from 2.7.10) I\'m suddenly unable to test register my package on PyPi from the PyCharm IDE console. Running (as an \"External Tool\") python -B setup.py register -r pypitest I now get Traceback (most recent call last): File \"setup.py\", line 22, in <module> from setuptools import setup File \"/usr/local/lib/python2.7/site-packages/setuptools/__init__.py\", line 12, in <module> from setuptools.extension import Extension File \"/usr/local/lib/python2

“pip install --editable ./” vs “python setup.py develop”

痴心易碎 提交于 2019-11-26 10:08:50
问题 Is there any significant difference between pip install -e /path/to/mypackage and the setuptools variant? python /path/to/mypackage/setup.py develop 回答1: Try to avoid calling setup.py directly, it will not properly tell pip that you've installed your package. With pip install -e : For local projects, the “SomeProject.egg-info” directory is created relative to the project path. This is one advantage over just using setup.py develop , which creates the “egg-info” directly relative the current

How can I add post-install scripts to easy_install / setuptools / distutils?

☆樱花仙子☆ 提交于 2019-11-26 09:36:57
问题 I would like to be able to add a hook to my setup.py that will be run post-install (either when easy_install\'ing or when doing python setup.py install). In my project, PySmell, I have some support files for Vim and Emacs. When a user installs PySmell the usual way, these files get copied in the actual egg, and the user has to fish them out and place them in his .vim or .emacs directories. What I want is either asking the user, post-installation, where would he like these files copied, or

Extending setuptools extension to use CMake in setup.py?

谁都会走 提交于 2019-11-26 09:34:07
问题 I\'m writing a Python extension that links a C++ library and I\'m using cmake to help with the build process. This means that right now, the only way I know how to bundle it, I have to first compile them with cmake before I can run setup.py bdist_wheel. There must be a better way. I was wondering if it\'s possible (or anybody has tried) to invoke CMake as part of the setup.py ext_modules build process? I\'m guessing there is a way to create a subclass of something but I\'m not sure where to

How do I remove packages installed with Python&#39;s easy_install?

大城市里の小女人 提交于 2019-11-26 09:21:56
Python's easy_install makes installing new packages extremely convenient. However, as far as I can tell, it doesn't implement the other common features of a dependency manager - listing and removing installed packages. What is the best way of finding out what's installed, and what is the preferred way of removing installed packages? Are there any files that need to be updated if I remove packages manually (e.g. by rm /usr/local/lib/python2.6/dist-packages/my_installed_pkg.egg or similar)? pip , an alternative to setuptools/easy_install, provides an "uninstall" command. Install pip according to

How include static files to setuptools - python package

倾然丶 夕夏残阳落幕 提交于 2019-11-26 09:08:34
问题 I want to include the ./static/data.txt to setuptools , here is my code: # setup.py import os,glob from setuptools import setup,find_packages setup( name = \"PotatoProject\", version = \"0.1.1\", author = \"Master Splinter\", author_email = \"splinter@initech.com\", description = (\"The potatoproject!\"), url = \'http://www.google.com\', license = \"BSD\", # adding packages packages=find_packages(\'src\'), package_dir = {\'\':\'src\'}, # trying to add files... include_package_data = True,

How can I get the version defined in setup.py (setuptools) in my package?

你。 提交于 2019-11-26 08:44:58
问题 How could I get the version defined in setup.py from my package (for --version , or other purposes)? 回答1: Interrogate version string of already-installed distribution To retrieve the version from inside your package at runtime (what your question appears to actually be asking), you can use: import pkg_resources # part of setuptools version = pkg_resources.require("MyProject")[0].version Store version string for use during install If you want to go the other way 'round (which appears to be

Post-install script with Python setuptools

别说谁变了你拦得住时间么 提交于 2019-11-26 07:32:50
Is it possible to specify a post-install Python script file as part of the setuptools setup.py file so that a user can run the command: python setup.py install on a local project file archive, or pip install <name> for a PyPI project and the script will be run at the completion of the standard setuptools install? I am looking to perform post-install tasks that can be coded in a single Python script file (e.g. deliver a custom post-install message to the user, pull additional data files from a different remote source repository). I came across this SO answer from several years ago that

setuptools: package data folder location

南楼画角 提交于 2019-11-26 07:19:19
问题 I use setuptools to distribute my python package. Now I need to distribute additional datafiles. From what I\'ve gathered fromt the setuptools documentation, I need to have my data files inside the package directory. However, I would rather have my datafiles inside a subdirectory in the root directory. What I would like to avoid: / #root |- src/ | |- mypackage/ | | |- data/ | | | |- resource1 | | | |- [...] | | |- __init__.py | | |- [...] |- setup.py What I would like to have instead: / #root

Installing SetupTools on 64-bit Windows

泪湿孤枕 提交于 2019-11-26 05:57:11
问题 I\'m running Python 2.7 on Windows 7 64-bit, and when I run the installer for setuptools it tells me that Python 2.7 is not installed. The specific error message is: `Python Version 2.7 required which was not found in the registry` My installed version of Python is: `Python 2.7 (r27:82525, Jul 4 2010, 07:43:08) [MSC v.1500 64 bit (AMD64)] on win32` I\'m looking at the setuptools site and it doesn\'t mention any installers for 64-bit Windows. Have I missed something or do I have to install