Ubuntu + virtualenv = a mess? virtualenv hates dist-packages, wants site-packages

前端 未结 5 513
渐次进展
渐次进展 2020-12-28 09:46

Can someone please explain to me what is going on with python in ubuntu 9.04?

I\'m trying to spin up virtualenv, and the --no-site-packages

5条回答
  •  爱一瞬间的悲伤
    2020-12-28 10:10

    You really should not touch Ubuntu's Python installation unless you are building system admin tools, or building something that could be considered to be a new system service.

    If you are using Ubuntu to develop or deploy Python applications, always build your own Python from source, tar it up, and use that for deployment. That way you will have all the directories in the right place and virtualenv will work normally. If you will deploy several Python apps on the server, then make your Python live in some place like /home/python or /opt/python or somewhere outside of your home directory. Make sure that you have write permissions for the developers group (users?) so that people can easily add packages.

    This also allows you to have two tiers of packages. The ones that are your in-house standard tools can be installed in your Python distro and be part of the tarball that you deploy, and only the app-specific packages would be in a virtualenv.

    Do not upgrade or modify the Ubuntu system installed Python.

提交回复
热议问题