簡體   English   中英

在Linux上的虛擬環境中安裝Distribution_setup.py時出錯

[英]error installing distribute_setup.py from virtual environment on linux

我已經嘗試了幾個小時,才能使distributed_setup.py正確安裝在活動的虛擬環境中。 我可以運行它,但總是會出錯。 任何幫助,將不勝感激。 我目前正在Ubuntu 12.10中嘗試這樣做。

謝謝!

 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) test@ubuntu:~$ 

(DjangoTutorial)是活動的虛擬環境

這是我嘗試構建依賴項時得到的信息

test@ubuntu:~/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
test@ubuntu:~/Code/Tutorial$ 

Python3.3安裝在/ usr / local / lib中

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

這似乎不是一個虛擬環境問題。 而是缺少您的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中包。

distribute_setup.py將嘗試(從網上)下載軟件包,然后安裝它。 也許您的下載由於某種原因而無法完成,這就是為什么下一步(提取壓縮包)失敗的原因。

您可以嘗試從此處下載源,然后手動安裝。

  1. 解壓縮下載的tar

    $ tar -xzvf distribute-0.6.36.tar.gz

  2. 轉到提取的目錄

    $ cd distribute-0.6.36

  3. 運行安裝

    $ python setup.py install

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM