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

哈!