setup.py

Including direct dependency download links in setup.py

江枫思渺然 提交于 2019-12-10 23:32:39
问题 Can one specify direct download links for Python egg dependencies? I have Skype4Py as a dependency and easy_install seems to fail to download the file correctly from sourceforge.net (sourceforge.net issue). The resulting tar file is scrambled. https://github.com/stigkj/Skype4Py/issues/3 To work around this issue I'd like to specify a direct download link for Skype4Py archive to avoid the issues with sourceforge.net. 回答1: First of all, I highly recommend using pip instead of easy_install as it

KeyError: 0L when running packaged code

拟墨画扇 提交于 2019-12-10 20:31:24
问题 I have script called rra.py that has the following skelton structure: usn="" usnl=[] from bs4 import BeautifulSoup import re import asys import glob import os import sys import sys def inputIndex(): #some processsing def getval(): #some processing def parsehtml(): #some processsing def ret(): #some processing def main(): inputIndex() ret() parsehtml() getval() print "watsuup" asys.Compavg() asys.compSub() print "nearly done" return 0 if __name__ == '__main__': inputIndex() main() asys.Compavg

Installing Flask project can't open setup.py

微笑、不失礼 提交于 2019-12-10 19:47:08
问题 I am following the Deploy to Production tutorial from Flask. I am required to run python setup.py bdist_wheel to build a wheel build distribution file. But that command gives this error: python: can't open file 'setup.py': [Errno 2] No such file or directory After searching, I found out that the file is supposed to be at the root of the library I am using. I couldn't find it at the root of the wheel or flask libraries. Where is the setup.py file that the tutorial is telling me to use? 回答1:

entry_points does not create custom scripts with pip or easy_install in Python?

心已入冬 提交于 2019-12-10 19:10:54
问题 I am using simple entry points to make a custom script, with this in setup.py : entry_points = { 'my_scripts': ['combine_stuff = mypackage.mymod.test:foo'] } where mypackage/mymod/test.py contains: import argh from argh import arg @arg("myarg", help="Test arg.") def foo(myarg): print "Got: ", myarg When I install my package using this (in same directory as setup.py ) pip install --user -e . The entry points do not get processed at all it seems. Why is that? If I install with distribute easy

Setup.py inside installed module

穿精又带淫゛_ 提交于 2019-12-10 18:58:40
问题 For a directory structure like the following, I haven't been able to make xy an importable package. xy ├── __init__.py ├── z │ ├── __init__.py │ └── stuff.py └── setup.py If the setup.py were a directory up, I could use from setuptools import setup setup(name='xy', packages=['xy']) but short of that, no combination of package_dir and packages has let me import xy , only import z . Unfortunately, moving the setup.py a directory up isn't really an option due to an excessive number of hard-coded

What does the “Py Version” in PyPI project page mean? And does it matter?

谁都会走 提交于 2019-12-10 18:47:28
问题 I notice that, most projects released on PyPI contain a "Py Version" meta data in their project page, but their values vary. If the package is not a universal package or not a pure python package, their values are understandably different, in order to denote their targeted platform, such as this nose page and this simplejson page. But some other universal pure (as far as I can tell) Python packages still contain slightly different content. For example: search "Py Version" in this requests

Can distutils perform a dependency check without installing?

自作多情 提交于 2019-12-10 17:34:14
问题 Is it possible to have distutils just run the python module dependency analysis (and possibly install missing modules) without actually installing the python module in question? I imagine a command as follows: ./setup.py check-dependencies that would report if any dependent modules are missing on the target system. 回答1: I think the closest you can get is: setup.py install -v -n which means to run a dry-run ( -n ) in verbose ( -v ) mode. You could also use the distuitls.dep_util module, it

Python Entry point 'console_scripts' not found

杀马特。学长 韩版系。学妹 提交于 2019-12-10 15:49:59
问题 I'm unable to import entry point console scripts in my python package. Looking for help debugging my current issue, as I have read every relevant post on the issue. Here is what my directory structure looks like: ├── ContentAnalysis │ ├── __init__.py │ ├── command_line.py │ ├── document.py │ ├── entities.py │ ├── sentiment.py │ ├── summary.py │ ├── text_tokenize.py │ ├── tokens.py ├── local-requirements.txt ├── requirements.txt ├── server-requirements.txt ├── setup.py └── tests ├── tests.py └

Including data files with setup.py

假如想象 提交于 2019-12-10 15:27:04
问题 I'm having trouble including data files in my setup.py script. My package is setup as follows: my_package/ setup.py MANIFEST.in my_package/ __init__.py access_data.py data_files/ my_data_file.csv I want to include the my_data_file.csv file when installing so that it can be read by access_data.py . To do so I used the package_data keyword in setuptools : setup(..., packages=['my_package'], package_data={'my_package': ['./my_package/data_files/my_data_file.csv']}, include_package_data=True ) I

After installation of Python package from Git repository some folders are missing

时光毁灭记忆、已成空白 提交于 2019-12-10 14:18:35
问题 I want to install a package from the following repo https://github.com/geomin/django-countria. The command I'm using is pip install git://github.com/geomin/django-countria.git . Pip clones the repo to a temporary folder and then runs setup.py . The problem is that after installation completes, site_packages containes files countria-0.8-py2.7.egg/countria/models.py and countria-0.8-py2.7.egg/countria/__init__.py but no fixtures and locale folders. If I clone the package and run setup.py I get