2016-12-14 103 views
0

我在OS X和我皮普安裝到皮普安裝到錯誤的目錄

/Library/Python/2.7/site-packages 

我想我的點子,安裝到:

/usr/local/lib/python2.7/site-packages 

我怎麼能做到這一點?安裝包使用

pip install --target=/usr/local/lib/python2.7/site-packages package_name 

安裝到您的target目錄時,我還沒有找到一種方法尚未

+1

Windows or mac? –

+0

OS X,現在更新答案 – Antoine

+1

可能的重複[如何更改pip安裝的默認目錄?](http://stackoverflow.com/questions/12595778/how-do-i-change-the-default -directory-that-pip-installs-to) – JakeGould

回答

2

PIP有目標目錄--target選項。

if target option not available, check pip version & for possible upgrade or as mentioned in comments the error may be related to OSX/Homebrew install, check here for details.

+0

'$ pip install --target =/Library/Python/2.7/site-包裹pydub'返回爲'DistutilsOptionError:必須提供家庭或前綴/ exec-前綴 - 不是兩個' – Antoine

+0

@AnonyMayfield更新回答與相關問題 –

+0

謝謝,當我回到我的限制(2小時) – Antoine