问题
this problem, I have when try install package netstat with pypi
[opmeitle@localhost ~]$ sudo pip install netstat
[sudo] password for opmeitle:
Downloading/unpacking netstat
Running setup.py egg_info for package netstat
file nester_g:.py (for module nester_g:) not found
Installing collected packages: netstat
Running setup.py install for netstat
file nester_g:.py (for module nester_g:) not found
file nester_g:.py (for module nester_g:) not found
warning: install_lib: 'build/lib' does not exist -- no Python modules to install
file nester_g:.py (for module nester_g:) not found
file nester_g:.py (for module nester_g:) not found
Successfully installed netstat
Cleaning up...
and other question: how to install packages in python2.7 and not in 3?
回答1:
While Kugel's answer is perfectly valid, I would also urge you to avoid system wide install, and to use a virtualenv. It will allow you to create a sandbox for your project and isolate it from others.
When creating a virtualenv, you can specify the Python interpreter version you want to use. For example, for python2.7:
$ virtualenv path/to/project -p /usr/bin/python2.7
Then, a pip install
command will automatically install the package for python2.7.
回答2:
The package you mention is corrupted / incomplete. Download source code from here and you can see there is only setup.py and no other source code. Beside that, the homepage is a broken link.
To install for a different version of python use
pip-2.7 install xxx
. There is usually a pip-x.y for each python version you have installed.
来源:https://stackoverflow.com/questions/13319591/how-to-install-package-with-pypi-in-python-2-7