I like to figure out the myth behind Python's namespace packages by setuptools, and here is what I did test.
virtualenv
.pip install
.The package I played with is zope.interface and it worked well with the following file hierarchy on my virtualenv:
~virenv/.../site-packages/zope.interface-3.8.0-py2.6-nspkg.pth
/zope.interface-3.8.0-py2.6.egg-info/
/zope/
/interface/
/...
Everything looked fine and I love the way zope.interface got installed as a real namespaced package (under folder zope).
Then, I did another test and that's the question I would like to ask for your help. I downloaded the tared zope.interface source file. I liked to play it manually again
virtualenv
.python setup.py install
.The site-packages looks like this:
~virenv/../site-packages/zope.interface-...egg/
/zope/
/__init__.py
/interface/
/EGG-INFO/
Q. How come I can't get the exactly result to pip install
by manually python setup.py install
?
To install a specific version of a Python package you can use pip: pip install YourPackage==YourVersion . For example, if you want to install an older version of Pandas you can do as follows: pip install pandas==1.1. 3 .
How to Manually Download Packages from PyPI. You can download packages directly from PyPI by doing the following: Point your browser at https://pypi.org/project/<packagename> Select either Download Files to download the current package version, or Release History to select the version of your choice.
Installing Python Packages with Setup.py To install a package that includes a setup.py file, open a command or terminal window and: cd into the root directory where setup.py is located. Enter: python setup.py install.
Verify the PIP Installation Process and Check the PIP Version. If PIP is installed correctly, we will see a message indicating the version of PIP and its location on the local system, like the following: pip 22.0. 2 from C:\Users\Utente\AppData\Local\Programs\Python\Python310\lib\site-packages\pip (python 3.10) .
pip
uses setup.py
internally. It just passes additional option to it. To reproduce what pip
is doing, execute
python setup.py install --single-version-externally-managed
You can also run pip -vv
to see exactly which commands are run.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With