问题描述:

I currently have 2 versions of python installed. 2.7.6 is the default version which shipped with Ubuntu 14. I also have 2.7.10 which I compiled from source installed in /opt/python2.7/

Is it possible to use the Ubuntu repository to install python packages for 2.7.10 which is stored in another directory? I understand I could use pip to do this but I'm just curious if apt-get could do the same thing.

Some of the packages I need are dateutils and Cheetah.

Thanks

网友答案:

Maybe you could use pyenv. And according to documentation you will have:

  • Let you change the global Python version on a per-user basis.
  • Provide support for per-project Python versions.
  • Allow you to override the Python version with an environment variable.
  • Search commands from multiple versions of Python at a time. This may be helpful to test across Python versions with tox.
网友答案:

Python packages are hosted by Python Software Foundation, which maintains the official repositories. PyPi deals only with python packages.

"apt-get" deals with Debian distros packages and it doesn't contain packages that need a "runtime".. like Python packages, NodeJS packages, ...

However, You can manually build python packages from sources. Take a look at this post

相关阅读:
Top