easy_install没有安装在正确的路径上?

时间:2014-02-07 17:10:45

标签: python python-3.x setuptools easy-install

所以我从源码安装-3.3获得python3.3.2并且我试图让它们很好地工作,但我在其中一个服务器中遇到了问题。在Ubuntu我只是这样做:

# Install python 3.3.2
cd /tmp/
wget http://www.python.org/ftp/python/3.3.2/Python-3.3.2.tar.bz2
tar xvf Python-3.3.2.tar.bz2
cd Python-3.3.2/
./configure --prefix=/usr/
make
make test
sudo make install

让python工作......这很好,然后:

# Install easy_install for python 3.3.2
cd /tmp/
wget https://pypi.python.org/packages/source/d/distribute/distribute-0.6.49.tar.gz
tar xzvf distribute-0.6.49.tar.gz
cd distribute-0.6.49
sudo python3 setup.py build
sudo python3 setup.py install

然后我可以在输出上看到一些奇怪的东西:

...

Extracting distribute-0.6.49-py3.3.egg to /usr/bin/lib/python3.3/site-packages
distribute 0.6.49 is already the active version in easy-install.pth
Installing easy_install script to /usr/bin/bin
Installing easy_install-3.3 script to /usr/bin/bin

...

为什么easy_install会被放置在/ usr / bin / bin ???? WTH ??

此外,我使用easy_install安装的所有内容都在那里:

sudo easy_install-3.3 gunicorn
Searching for gunicorn
Best match: gunicorn 18.0
Processing gunicorn-18.0-py3.3.egg
gunicorn 18.0 is already the active version in easy-install.pth
Installing gunicorn_django script to /usr/bin/bin
Installing gunicorn script to /usr/bin/bin
Installing gunicorn_paster script to /usr/bin/bin

Using /usr/bin/lib/python3.3/site-packages/gunicorn-18.0-py3.3.egg
Processing dependencies for gunicorn
Finished processing dependencies for gunicorn

虽然:

哪个python3 哪个easy_install-3.3 都指向 / usr / bin 正如预期的那样!

当然所有二进制文件都在那里,但它们在PATH上无法访问...而且我不想编辑我的PATH env变量......对于发生了什么的任何想法?

1 个答案:

答案 0 :(得分:0)

我完全修改了我的python安装!现在它正在发挥作用。我不知道发生了什么,但stackoverflow用户首先关心解决问题......这就是我所做的:

  1. 清除python3的每一条路径...... 请注意这个命令,它们会吹嘘你的PYTHON3安装。

    sudo apt-get remove python3
    sudo apt-get remove python3.2*
    sudo apt-get remove python3.3*
    sudo apt-get remove python3.4*
    sudo apt-get remove python-sphinx
    sudo apt-get autoremove
    sudo rm -rf /usr/bin/bin/
    sudo rm -rf /usr/lib/python3*
    sudo rm /usr/bin/python3*
    sudo reboot
    
  2. 重新安装依赖项以构建python

      

    sudo apt-get build-dep -y python3 python-setuptools

  3. 我安装了3.3.3,因为3.3.2给了我一些测试的问题。

    cd /tmp/
    wget http://www.python.org/ftp/python/3.3.3/Python-3.3.3.tar.bz2
    tar xvf Python-3.3.3.tar.bz2
    cd Python-3.3.3/
    ./configure --prefix=/usr/
    make
    make test
    sudo make install
    python3 --version
    
  4. 现在easy_install !!!

    cd /tmp/
    wget https://pypi.python.org/packages/source/d/distribute/distribute-0.6.49.tar.gz
    tar xzvf distribute-0.6.49.tar.gz
    cd distribute-0.6.49
    sudo python3 setup.py build
    sudo python3 setup.py install
    
  5. 修复一些权限问题

    sudo chmod +r /usr/lib/python3.3/site-packages/python_dateutil-*-py3.3.egg/EGG-INFO/top_level.txt
    sudo chmod +r /usr/lib/python3.3/site-packages/python3_digest-1.8b4-py3.3.egg/EGG-INFO/top_level.txt
    mkdir -p $HOME/.config/ipython
    sudo chown -R $USER:$USER $HOME/.config/ipython
    sudo chmod g+w $HOME/.config/ipython
    sudo ln -sf /usr/bin/ipython3 /usr/bin/ipython  # this is more for me... maybe you don't want this one... it will open ipython3 on `ipython` command.
    
  6. 试试吧!

    sudo easy_install-3.3 ipython gunicorn
    
  7. 现在一切都井井有条!

    Adding gunicorn 18.0 to easy-install.pth file
    Installing gunicorn script to /usr/bin
    Installing gunicorn_django script to /usr/bin
    Installing gunicorn_paster script to /usr/bin
    

    检查 / usr / bin !!!!你不想舔它吗?

    哈!