2014-02-07 40 views
0

所以我从源代码easy-install-3.3获得了python3.3.2,并且试图让它们很好地工作,但是我在其中一个服务器中遇到问题。在Ubuntu中,我只是这样做:easy_install没有安装在正确的路径上?

# 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变量......关于正在发生什么的任何想法?

+0

你可以做'哪个python3'吗? – poke

+0

按预期方式位于/ usr/bin/python3中 – mimoralea

回答

0

我完全毁了我的python安装!现在它正在工作。我没有一个线索发生了什么事,但计算器用户关心的解决首先想到......这里是我做过什么:

  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 
    

而且一切都是为了现在!

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中了!!!!你不只是想舔它!?

哈!