Python/IPython ImportError: no module named site

后端 未结 3 940
长情又很酷
长情又很酷 2020-12-08 14:58

I had python 2.7.3 and ipython 1.2 up and running correctly on my Linux system (ubuntu 12.04) but was trying to install a

3条回答
  •  萌比男神i
    2020-12-08 15:32

    PYTHONHOME

    Change the location of the standard Python libraries. By default, the libraries are searched in prefix/lib/pythonversion and exec_prefix/lib/pythonversion, where prefix and exec_prefix are installation-dependent directories, both defaulting to /usr/local.

    When PYTHONHOME is set to a single directory, its value replaces both prefix and exec_prefix. To specify different values for these, set PYTHONHOME to prefix:exec_prefix.

    Try to clean up your PYTHONHOME:

    user$ export PYTHONHOME=
    

    As for installing matplotlib, I would recommend the following:

    sudo apt-get install python-matplotlib
    

    (details here)

提交回复
热议问题