2016-04-29 81 views
1

我在我的Anaconda中的mac(2.7和3.5.1)版本中有Python的2個版本。當我每個我python anaconda - 爲不同的python版本管理模塊

pip install xxx 

它會自動進入/anaconda/lib/python2.7/site-packages文件夾。 現在我想學習aiohttp,當我安裝它

pip install aiohttp 

它會給我錯誤:

raise RuntimeError("aiohttp requires Python 3.4.1+") RuntimeError: aiohttp requires Python 3.4.1+

---------------------------------------- Command "python setup.py egg_info" failed with error code 1 in 

/private/var/folders/c2/3yxfnvc51fng531jz312t00m0000gn/T/pip-build-m_mCpM/aiohttp/

  1. 我怎樣才能解決這個問題?
  2. 什麼是管理PythonAnaconda的2個版本的最佳方法?
+0

如果您有Anaconda,爲什麼使用pip? –

+0

另外,請嘗試'pip3 install aiohttp' –

+0

因爲Anaconda沒有'aiohttp'。 – sooon

回答

0

一般來說,您可以創建新的環境,無論您需要什麼樣的項目,都可以使用任何python和packages。在這種特定的實例,如果你想使用需要較高蟒aiohttp,我會做到以下幾點:

conda create -n py35 python=3.5 
source activate py35 
pip install aiohttp 

這將在您的py35環境中安裝aiohttp。

0

我只是找到了解決辦法:

python2 -m pip install SomePackage # default Python 2 
python2.7 -m pip install SomePackage # specifically Python 2.7 
python3 -m pip install SomePackage # default Python 3 
python3.4 -m pip install SomePackage # specifically Python 3.4 

python.org

+1

你也可以嘗試:'conda install -c pypi aiohttp' –

相關問題