2013-04-19 87 views
1

我一直在嘗試幾個小時才能讓distribute_setup.py在活動的虛擬環境中正確安裝。我得到它運行,但我總是得到一個錯誤。任何幫助,將不勝感激。我目前正在嘗試在Ubuntu 12.10中做到這一點。在Linux上從虛擬環境安裝distribute_setup.py時出錯

謝謝!

python distribute_setup.py 
Extracting in /tmp/tmpvmrkpz 
Traceback (most recent call last): 
File "distribute_setup.py", line 546, in <module> 
sys.exit(main()) 
File "distribute_setup.py", line 543, in main 
return _install(tarball, _build_install_args(options)) 
File "distribute_setup.py", line 76, in _install 
tar = tarfile.open(tarball) 
File "/usr/local/lib/python3.3/tarfile.py", line 1571, in open 
raise ReadError("file could not be opened successfully") 
tarfile.ReadError: file could not be opened successfully 
(DjangoTutorial) [email protected]:~$ 

(DjangoTutorial)是活動的虛擬環境

這裏是我得到的,當我嘗試建立

[email protected]:~/Code/Tutorial$ sudo apt-get build-dep python3 
Reading package lists... Done 
Building dependency tree  
Reading state information... Done 
E: You must put some 'source' URIs in your sources.list 
[email protected]:~/Code/Tutorial$ 

Python3.3安裝在/ usr/local/lib目錄的依賴

我也嘗試重新安裝ubuntu和python3.3,它仍然無法正常工作!

+0

您使用的是哪種Linux發行版?大多數提供預製包裝。 – Blender

+0

我使用的是Ubuntu 10.10 –

+0

你有足夠的磁盤空間來下載tar文件嗎?或者將它解壓到tmp? – Thorfin

回答

4

這似乎不是虛擬環境問題。而不是你的python安裝缺少依賴關係的問題。嘗試

sudo apt-get build-dep python3 

然後嘗試再次配置和生成python3.3。同時添加-dev包

sudo apt-get install python3.3-dev 

現在嘗試安裝軟件包。很可能你想再次創建你的虛擬環境。

tarfile.py嘗試使用四種提取方法之一(tar,gzip,bz2,xopen)打開tarball,如果它無法在python庫中找到相應的模塊(它們中的某些模塊可能不包含)在基本的python包中。

+0

不幸的是,這並沒有奏效。我無法使build-dep python3成功運行。有任何想法嗎? –

+0

你可以分享錯誤作爲你的問題編輯。此外,請指出您的python3.3安裝位置,以便在重新配置之前更容易將其刪除。 – JunkMechanic

+0

只需添加更多細節。謝謝您的幫助! –

2

distribute_setup.py將嘗試從網上下載軟件包並安裝它。也許你的下載無法完成,這就是爲什麼下一步(解壓縮tarball)失敗。

您可以嘗試從here下載源代碼,然後手動安裝。

  1. 解壓下載的焦油

    $ tar -xzvf distribute-0.6.36.tar.gz

  2. 切換到解壓目錄

    $ cd distribute-0.6.36

  3. 運行安裝

    $ python setup.py install

相關問題