Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
287 views
in Technique[技术] by (71.8m points)

python - windows pip installing libraries in wrong directory

I have python 3.5 on windows 7 machine and this machine does not have any other python version.
pip comes with python 3.5 installation.

I used pip to install selenium libraries

pip install selenium

It installed the library at:
AppDataLocalVirtualStoreProgram Files (x86)Python 3.5Libsite-packages

But IDE like pycharm looks in:
C:Program Files (x86)Python 3.5Libsite-packages

And that is where it should be installed.

Because of this IDE is not recognizing the library and I am not able to get any help in IDE.

As a workaround I copied the library to the desired folder and it is working, but I want to know how I can configure pip to right away install at C:Program Files (x86)Python 3.5Libsite-packages

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I got the solution. Thanks @edrw for throwing light on -t flag.

Even though you put the specific location using -t flag, it just installs in the AppData directory and the reason is when command prompt was open it was not with administrator privileges.

Solution: Close the command prompt. Open it with "Run as administrator" Run command "pip install selenium"

It should install at the correct location, reason is you need administrator permissions to copy or delete files from Program Files (x86) folder.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...