开发者

Installing python library to a custom location?

开发者 https://www.devze.com 2023-03-11 22:28 出处:网络
I want to use a co开发者_StackOverflow社区uple of third party django packages for my application. So, I want to install each package locally for that application (or my whole project).

I want to use a co开发者_StackOverflow社区uple of third party django packages for my application. So, I want to install each package locally for that application (or my whole project).

The python custom installation instructions look a bit scary - how do I do this as simply as possible?


You can just put the library module into your project folder because your project folder will be in the PYTHONPATH automatically when running via manage.py runserver or your wsgi script will point to it when running on production.

Usually all python packages are packaged like this:

package directory
    module directory
    ... other files/dirs like README, Manifest and so on

What need to be in your Django project folder is only the module directory part from the example above, not the rest of the package.


Use virtualenv.

That is by far the best solution for installing custom packages for each project.


Just use --home - nothing scary about it.

Don't forget to make your PYTHONPATH point there, though.

0

精彩评论

暂无评论...
验证码 换一张
取 消