我在postgres中使用PL/Pythonu擴展在python中編寫函數。我希望postgres使用我的virutal環境(我使用virtualenv)而不是全局安裝。我如何去做這件事?在virtualenv中使用PL/Pythonu
2
A
回答
4
事實證明,必須在postgres中添加找到庫的路徑到PYTHONPATH環境變量。不要忘了你的值,例如,引述如下:
PYTHONPATH =「路徑庫」
2
在回答了https://stackoverflow.com/a/24892335/5430
TL;博士 - plpython函數內部高管activate_this.py將設置蟒蛇解釋器的postgresql會話的生活。
相關問題
- 1. 在Windows上安裝plpythonu
- 2. epmaint在emacs中使用virtualenv
- 3. 在virtualenv中使用gaetestbed
- 4. Virtualenv:使用python 3.5在virtualenv env中運行`Scrapy`給出錯誤
- 5. 使用virtualenv
- 6. 使用的virtualenv
- 7. 使用C++中的virtualenv
- 8. 在eclipse上使用virtualenv
- 9. 如何在virtualenv中使用ConfigParser?
- 10. 在Virtualenv中使用Python的Pip
- 11. 如何在python中使用virtualenv和pip
- 12. Python - 使用在virtualenv中安裝的Django
- 13. 如何在makefile中使用virtualenv
- 14. 在Pycharm中使用virtualenv作爲Django IDE
- 15. 在Mac OS X中使用python virtualenv 10.6.8
- 16. 在virtualenv中使用Flask-Babel失敗
- 17. 不能在virtualenv中使用wxPython?
- 18. 在ubuntu-lucid中使用virtualenv安裝python2.7
- 19. 0MQ在virtualenv中
- 20. 在virtualenv中
- 21. 使用spyder與virtualenv
- 22. PIP使用的virtualenv
- 23. Pyenv - virtualenv如何指定使用.file使用的virtualenv?
- 24. 無法在virtualenv中
- 25. 不能在virtualenv中
- 26. 皮普在virtualenv中
- 27. 的Django在virtualenv中
- 28. 的Django在virtualenv中
- 29. 錯誤在PostgreSQL:用於創建語言plpythonu
- 30. 如何在plpythonu函數中編寫plpgsql代碼(PostgreSQL)
如http://stackoverflow.com/q/9586331/217844中所述,這似乎只適用於某些操作系統。理想情況下,Postgres應該有一個VIRTUALENV配置設置。 – ssc