setup.py

How to force a python wheel to be platform specific when building it?

穿精又带淫゛_ 提交于 2019-12-17 09:46:15
问题 I am working on a python2 package in which the setup.py contains some custom install commands. These commands actually build some Rust code and output some .dylib files that are moved into the python package. An important point is that the Rust code is outside the python package. setuptools is supposed to detect automatically if the python package is pure python or platform specific (if it contains some C extensions for instance). In my case, when I run python setup.py bdist_wheel , the

python setup.py uninstall

陌路散爱 提交于 2019-12-17 01:13:12
问题 I have installed a python package with python setup.py install . How do I uninstall it? 回答1: Note: Avoid using python setup.py install use pip install . You need to remove all files manually, and also undo any other stuff that installation did manually. If you don't know the list of all files, you can reinstall it with the --record option, and take a look at the list this produces. To record a list of installed files, you can use: python setup.py install --record files.txt Once you want to

python setup.py uninstall

旧城冷巷雨未停 提交于 2019-12-17 01:13:11
问题 I have installed a python package with python setup.py install . How do I uninstall it? 回答1: Note: Avoid using python setup.py install use pip install . You need to remove all files manually, and also undo any other stuff that installation did manually. If you don't know the list of all files, you can reinstall it with the --record option, and take a look at the list this produces. To record a list of installed files, you can use: python setup.py install --record files.txt Once you want to

Installed Python script cannot import package modules

非 Y 不嫁゛ 提交于 2019-12-13 14:31:45
问题 I have created a Python package with the following directory structure: / LICENSE MANIFEST.IN README.rst VERSION docs/ multitool/ __init__.py core/ __init__.py classes.py utils.py libs/ multitool.py tests/ tools/ __init__.py hashtool.py webtool.py setup.py The goal is to create a command line application (multitool.py) that 3rd parties can add to by adding their own files to the tools directory. This is accomplished by having them subclass a class that I've created. For example, these are the

Python - download packages from own server

限于喜欢 提交于 2019-12-13 09:51:29
问题 I wonder how can I force setup.py install command to download packages (via pip) from my server. I can get pip my server address but every dependecies are downloaded from pip server. Maybe solution is pip.ini/pip.conf? Tomek 回答1: From the docs, you can use the: --use-mirrors --mirrors <url> flag in pip to specify which mirror to use. From command line, you can also speicify mirrors. For example: pip install -i http://d.pypi.python.org/simple $PACKAGE 来源: https://stackoverflow.com/questions

setup.py's sdist, bdist and install behaving differently regarding data_files

☆樱花仙子☆ 提交于 2019-12-12 15:22:09
问题 I'm trying to distribute web assets along with a web app that I'm trying to package, but I'm failing miserably. I don't understand why I have a different list of files installed or packages when I run bdist, sdist, or install. Project Layout The project runs with python 3 on Arch. The results are the same with Py3 on Raspbian. I've done a very trimmed down version to make things simpler, which I describe here. The files layout is as follow : data/index.html MANIFEST.in mylib.py setup.py The

Install Virtualenv without internet connectivity

旧城冷巷雨未停 提交于 2019-12-12 06:23:51
问题 I need to set up a lab environment where the audience may not necessarily have internet connectivity at the venue. There are just a few packages that I need to explain to the audience. I am trying to make use of virtualenv to do all this. So using pip install I have successfully been able to install virtualenv. After this I activate my virtual env. And then while in there I use pip install again to install the other required modules, like requests etc. Now since my audience may not have

Folderless namespaced packages with setuptools

心不动则不痛 提交于 2019-12-12 05:16:34
问题 I have once seen a Python package with one flat src/ folder containing setup.py , but which still declare itself as namespace or namespace.foo package and you can import files from the package as from namespace.foo import x . This was done with some setup.py option and tricks. However, I have unable to find the source or the package how this was done and I am now looking for examples for it. 来源: https://stackoverflow.com/questions/9587667/folderless-namespaced-packages-with-setuptools

How to place a common code for different projects

我是研究僧i 提交于 2019-12-12 02:25:49
问题 I've got two python projects in a separate folders. And I also have a common code which I use in both of my projects. What is the best way to organize to them on filesystem to use distutils with setup.py to build them? My first idea was to use the structure like this: workspace | |- common lib | | | `- ... | |- project 1 | | | |- ... | `- setup.py | `- project 2 | |- ... `- setup.py and modify the python path environment variable in projects to find the code, but I've run into problems when I

How to import a PIP package through Jython?

风格不统一 提交于 2019-12-12 02:13:23
问题 In reference to hooking into PIP from Jython, It looks like, possibly, PIP is included with Jython: How can I install various Python libraries in Jython? Jython easy_install error How can I use jython setup.py install? How, specifically, from Jython itself, is PIP invoked? Both to install a package and, more importantly, to import that package for reference? I've seen no specific code examples written in Jython. 回答1: Once Jython 2.7 is installed to ~/ then: thufir@doge:~$ thufir@doge:~$