pypi

Python package dependency tree

半腔热情 提交于 2019-12-02 17:12:30
I would like to analyze the dependency tree of Python packages. How can I obtain this data? Things I already know setup.py sometimes contains a requires field that lists package dependencies PyPi is an online repository of Python packages PyPi has an API Things that I don't know Very few projects (around 10%) on PyPi explicitly list dependencies in the requires field but pip/easy_install still manage to download the correct packages. What am I missing? For example the popular library for statistical computing, pandas , doesn't list requires but still manages to install numpy , pytz , etc....

Install py2exe for python 2.7 over pip: this package requires Python 3.3 or later

二次信任 提交于 2019-12-02 17:00:12
>>> python -c "import sys; print sys.version" 2.7.6 (default, Nov 10 2013, 19:24:18) [MSC v.1500 32 bit (Intel)] >>> pip --version pip 1.5.5 from C:\Python27\lib\site-packages (python 2.7) >>> pip install py2exe <mumble grumble..> RuntimeError: This package requires Python 3.3 or later though official py2exe download page says they have exactly what I need: So how to install py2exe over pip? It is missing from pypi , if you click on the 0.6.9 link it brings you to the 0.9.2.0 python 3 package, there seems to be no 0.6.9 package available to download. Try using pip install http://sourceforge

How do I automatically install missing python modules? [duplicate]

僤鯓⒐⒋嵵緔 提交于 2019-12-02 16:13:33
This question already has an answer here: Installing python module within code 16 answers I would like to be able to write: try: import foo except ImportError: install_the_module("foo") What is the recommended/idiomatic way to handle this scenario? I've seen a lot of scripts simply print an error or warning notifying the user about the missing module and (sometimes) providing instructions on how to install. However, if I know the module is available on PyPI , then I could surely take this a step further an initiate the installation process. No? Andreas Jung Installation issues are not subject

Private PyPI containing package with same name

和自甴很熟 提交于 2019-12-02 08:53:42
问题 I am setting up my own PyPI containing some private packages. The problem is that some of the private packages have the same name as existing packages in PyPI. The private packages with same name do not necessarily have higher version number than the existing packages in PyPI, therefore when I do pip install --extra-index-url <Private_PyPI_URL> , pip will automatically download the packages with higher version number which may not be the one from my private repository. How can I make pip

Python console_scripts doesn't work when pip install --user

橙三吉。 提交于 2019-12-02 07:30:24
I wrapped my code into python package and now I want it to be also runnable from the command line (linux). So I added console_scripts tag to setup.py and all seems to be working fine when I pip install it as a root. (I can run program from the command line) However I'd also like for a package to be installed by using pip install --user . so it can be installed on computers when root is not available to the user. However when I try to invoke program from the command line i got 'command not found'. The pip installation finishes successfully and I can still run it using python my_prog.py But I

Private PyPI containing package with same name

╄→尐↘猪︶ㄣ 提交于 2019-12-02 06:36:47
I am setting up my own PyPI containing some private packages. The problem is that some of the private packages have the same name as existing packages in PyPI. The private packages with same name do not necessarily have higher version number than the existing packages in PyPI, therefore when I do pip install --extra-index-url <Private_PyPI_URL> , pip will automatically download the packages with higher version number which may not be the one from my private repository. How can I make pip install check PyPI for packages only if it fails to find the package from the private repository? Note also

How to exclude a single file from package with setuptools and setup.py

自闭症网瘾萝莉.ら 提交于 2019-12-01 09:13:38
I am working on blowdrycss . The repository is here . I want the settings file for blowdrycss_settings.py to be excluded from the final package on pypi. The intention is to dynamically build a custom settings file that will be placed in the users virtualenv / project folder. In setup.py , I have the following: packages=find_packages(exclude=['blowdrycss_settings.py', ]), I also tried exclude_package_data : exclude_package_data={ '': ['blowdrycss_settings.py'], '': ['blowdrycss/blowdrycss_settings.py'], 'blowdrycss': ['blowdrycss_settings.py'], }, I then run python setup.py sdist bdist .

A guide for updating packages on PyPi

℡╲_俬逩灬. 提交于 2019-12-01 06:36:04
I used this guide to install a new package on PyPi. Now, I want to update the package. Since I found no guide for this, I tried to do it myself: I updated the version from "1.0.0.dev1" to "1.0.0.dev2" and re-installed. It did not work: I got: Uploading tee_table-1.0.0.dev1-py3-none-any.whl HTTPError: 400 Client Error: File already exists. See https://pypi.org/help/#file-name-reuse for url: https://upload.pypi.org/legacy/ I also read this question but the information seems outdated (from 2012). Is there a simple user guide that describes how to upload a new version of a package to PyPi? I found

How to exclude a single file from package with setuptools and setup.py

强颜欢笑 提交于 2019-12-01 05:42:01
问题 I am working on blowdrycss . The repository is here. I want the settings file for blowdrycss_settings.py to be excluded from the final package on pypi. The intention is to dynamically build a custom settings file that will be placed in the users virtualenv / project folder. In setup.py , I have the following: packages=find_packages(exclude=['blowdrycss_settings.py', ]), I also tried exclude_package_data: exclude_package_data={ '': ['blowdrycss_settings.py'], '': ['blowdrycss/blowdrycss

'pip setup.py bdist_wheel' no longer builds forced non-pure wheels

本秂侑毒 提交于 2019-12-01 03:59:44
I have a project that compiles with C extensions on Linux, but without them on Windows. When I first generated the wheel files on Windows with python setup.py bdist_wheel , they became universal, and I could not upload them to PyPI as these universal wheels are preferred by pip for installation over the .tar.gz uploads (the result from python setup.py sdist ). The trick around this was to specify in the setup.py : Distribution.is_pure = lambda *args: False or by subclassing Distribution : class BinaryDistribution(Distribution): def is_pure(self): return False and calling setup() in setup.py