2

For context, I'm trying to point pip at the directory that PyCharm is using. Running OSX High Sierra. Google hasn't had any answers yet (As far as I can tell).

In the command line, if I enter

pip install SpeechRecognition -t /Library/Frameworks/Python.framework/Versions/3.4/bin/python3.4/site-packages 

It gives me

OSError: [Errno 20] Not a directory

If I try

pip install SpeechRecognition -t /Library/Frameworks/Python.framework/Versions/3.4/bin/python3.4/ 

I get

ERROR: Target path exists but is not a directory, will not continue.

I tried updating pip, and still no luck. What should I try next?

1 Answer 1

1

The target dir you're trying to specify is incorrect - it should be

/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages

(lib dir instead of bin that stores the executables).

However, it looks like you are trying to install into the python dist's default site packages dir - you shouldn't need to explicitly specify the target dir in this case. Instead, use the correct pip executable:

$ pip3.4 install SpeechRecognition 

If pip3.4 executable is not available, use the one bundled with Python 3.4:

$ python3.4 -m pip install SpeechRecognition 
Sign up to request clarification or add additional context in comments.

4 Comments

Huh. pip is already pointed at the path you mentioned. PyCharm says that the interpreter is /Library/Frameworks/Python.framework/Versions/3.4/bin/python3.4. Is that weird? Should I be trying to reconfigure that instead? The lib path isn't one of the Pycham options listed.
The interpreter is indeed bin/python3.4, but it is just the interpreter's executable file and not a directory where the packages are installed - this would be lib/python3.4/site-packages. This dir will be automatically resolved from the path to interpreters executable. However, do you experience any troubles with PyCharm after you installed SpeechRecognition? If your project in PyCharm uses the same interpreter, it should recognize the newly installed package just fine.
Eureka! Thank you.
Glad I could help!

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.