pythonpath

How to get the PYTHONPATH in shell?

我们两清 提交于 2019-12-03 04:43:15
问题 debian@debian:~$ echo $PYTHONPATH /home/qiime/lib/: debian@debian:~$ python Python 2.7.3 (default, Jan 2 2013, 16:53:07) [GCC 4.7.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path ['', '/usr/local/lib/python2.7/dist-packages/feedparser-5.1.3-py2.7.egg', '/usr/local/lib/python2.7/dist-packages/stripogram-1.5-py2.7.egg', '/home/qiime/lib', '/home/debian', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-linux2', '/usr/lib/python2.7/lib

how to set different PYTHONPATH variables for python3 and python2 respectively

你离开我真会死。 提交于 2019-12-03 02:13:29
问题 I want to add a specific library path only to python2. After adding export PYTHONPATH="/path/to/lib/" to my .bashrc , however, executing python3 gets the error: Your PYTHONPATH points to a site-packages dir for Python 2.x but you are running Python 3.x! I think it is due to that python2 and python3 share the common PYTHONPATH variable. So, can I set different PYTHONPATH variables respectively for python2 and python3. If not, how can I add a library path exclusively to a particular version of

ERROR: virtualenvwrapper could not find virtualenv in your path

这一生的挚爱 提交于 2019-12-03 01:02:23
I'm trying to create a virtualenv with virtualenvwrapper , but when I use mkvirtualenv I get the following : ERROR: virtualenvwrapper could not find virtualenv in your path I assumed it was a PYTHONPATH problem. But if I do a pip show virtualenv I get the following : --- Metadata-Version: 2.0 Name: virtualenv Version: 13.1.0 Summary: Virtual Python Environment builder Home-page: https://virtualenv.pypa.io/ Author: Jannis Leidel, Carl Meyer and Brian Rosner Author-email: python-virtualenv@groups.google.com License: MIT Location: /Volumes/Data/nfs/zfs-student-3/users/2013_paris/vmonteco/Library

Python: ImportError no module named urllib

早过忘川 提交于 2019-12-02 18:45:54
问题 I just rented a VPS from Linode which has python2.5 and ubuntu 8.04. When I run this command from python shell: import urllib I get: ImportError: No module named urllib What can be the reason? How can I add this module to python? Isn't it prepackaged with the basic version? Can it be PYTHONPATH problem? 回答1: Ok, I resolved the issue. Somehow, python-tk package (which includes urllib) was missing. So the following line fixed the problem apt-get install python-tk 回答2: I use a later OS, so I don

How to get the PYTHONPATH in shell?

前提是你 提交于 2019-12-02 17:52:35
debian@debian:~$ echo $PYTHONPATH /home/qiime/lib/: debian@debian:~$ python Python 2.7.3 (default, Jan 2 2013, 16:53:07) [GCC 4.7.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path ['', '/usr/local/lib/python2.7/dist-packages/feedparser-5.1.3-py2.7.egg', '/usr/local/lib/python2.7/dist-packages/stripogram-1.5-py2.7.egg', '/home/qiime/lib', '/home/debian', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-linux2', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib- dynload', '/usr/local/lib/python2.7/dist

how to set different PYTHONPATH variables for python3 and python2 respectively

本小妞迷上赌 提交于 2019-12-02 17:16:23
I want to add a specific library path only to python2. After adding export PYTHONPATH="/path/to/lib/" to my .bashrc , however, executing python3 gets the error: Your PYTHONPATH points to a site-packages dir for Python 2.x but you are running Python 3.x! I think it is due to that python2 and python3 share the common PYTHONPATH variable. So, can I set different PYTHONPATH variables respectively for python2 and python3. If not, how can I add a library path exclusively to a particular version of python? You can create a configuration file mymodule.pth under lib/site-packages (on Windows) or lib

Dynamically updating the PYTHONPATH prevents .pyc update

梦想与她 提交于 2019-12-02 14:33:04
问题 To allow myself to have a clear filestructure in my project i am using the following code snippet to dynamically add the project main folder to the PYTHONPATH and therefore assure that I can import files even from above a files location. import sys import os sys.path.insert(0, os.path.join(os.path.dirname(os.path.realpath(__file__)), ".")) Since I did this, when I start my main file, changes to the modules aren't recognized anymore until i manually delete any .pyc files. Thus I assume this

Python: ImportError no module named urllib

馋奶兔 提交于 2019-12-02 10:34:49
I just rented a VPS from Linode which has python2.5 and ubuntu 8.04. When I run this command from python shell: import urllib I get: ImportError: No module named urllib What can be the reason? How can I add this module to python? Isn't it prepackaged with the basic version? Can it be PYTHONPATH problem? Ok, I resolved the issue. Somehow, python-tk package (which includes urllib) was missing. So the following line fixed the problem apt-get install python-tk I use a later OS, so I don't know if this will help, but just in case: marcelo@localhost:~$ lsb_release -a No LSB modules are available.

Aptana Python stdlib issue with virtualenv

∥☆過路亽.° 提交于 2019-12-02 08:11:28
I recently started working on a project using just vim as my text editor with a virtualenv setup. I installed a few API's on this virtualenv from GitHub. Eventually, the project got a little bigger than vim could handle so I had to move the project to an IDE. I chose Aptana Studio 3. When I started up Aptana, I pointed the project directory to the virtualenv folder that I had created to house my project. I then pointed the interpreter at the Python executable in App/bin (created from virtualenv)/python2.7. When I started reworking the code to make sure I had everything mapped correctly, I was

How to fix the python path

瘦欲@ 提交于 2019-12-02 06:57:22
I have python 2.7.2 installed on my Mac. I installed using python-2.7.2-macosx10.6.dmg I have only one instance of python. When i type in the terminal to find the python path , I get this : python Python 2.7.2 (v2.7.2:8527427914a2, Jun 11 2011, 15:22:34) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import os.path >>> os.environ['PYTHONPATH'].split(os.pathsep) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/UserDict.py",