I've been trying to import speech_recognition and pyttsx3. However, I can't find the modules available to install when I go to File->Preferences for New Project->Project interpreter. I then installed it using pip in my terminal, but it didn't do anything in pycharm despite it being successful in the terminal.
Asked
Active
Viewed 531 times
0
-
1What was the error message? And you mean you ran `pip install` from the terminal **within** PyCharm? or the command prompt of your machine? – Reedinationer Mar 15 '19 at 21:23
-
can you post the location of your interpreter? There should be a file path. – Aaron Arima Mar 15 '19 at 21:26
-
I used my computer's terminal, I didn't know pycharm had one. – Daniel dos Santos Mar 15 '19 at 21:28
-
1It's the same thing. You can access your systems terminal at the very bottom of pycharm. It should say terminal. Try installing your packages through there using pip. – Aaron Arima Mar 15 '19 at 21:30
-
I got, bash: pip: command not found – Daniel dos Santos Mar 15 '19 at 21:31
-
1hmm can you post the location of the projects interpreter? It should say next to the python version in the `Project Interpreter` setting – Aaron Arima Mar 15 '19 at 21:32
-
1should be a file path like `/usr/bin/python` or `/User/{my_username}/venv/bin/python` if on mac – Aaron Arima Mar 15 '19 at 21:37
-
~/.conda/envs/Abitt/bin/python – Daniel dos Santos Mar 15 '19 at 21:37
-
1cool thanks. In your terminal type `source ~/.conda/envs/Abitt/bin/activate` and then type `pip freeze`. You should see what is installed on that python interpreter. Do you see the packages that you installed? – Aaron Arima Mar 15 '19 at 21:39
-
I got source: filename argument required source: usage: source filename [arguments] – Daniel dos Santos Mar 15 '19 at 21:44
-
1ah i think conda env should have the python version after the activate file try something like `source ~/.conda/envs/Abitt/bin/activate py37` 37 represents the python version that you are using. The latest one thats out is 3.7 but replace it with the correct version. For example if you are using python 2.7 , the command would be `source ~/.conda/envs/Abitt/bin/activate py27` edit: also could be `conda ~/.conda/envs/Abitt/bin/activate` I'm not not to familiar with anaconda – Aaron Arima Mar 15 '19 at 21:49
-
I got, No such file or directory – Daniel dos Santos Mar 15 '19 at 21:52
-
1did you try the command using `conda` instead of source `conda ~/.conda/envs/Abitt/bin/activate` – Aaron Arima Mar 15 '19 at 21:54
-
can you use `conda list -n Abitt`? – Aaron Arima Mar 15 '19 at 21:59
-
I got; usage: conda [-h] [-V] command ... conda: error: argument command: invalid choice: '/Users/danieldossantos/.conda/envs/Abitt/bin/activate' (choose from 'clean', 'config', 'create', 'help', 'info', 'init', 'install', 'list', 'package', 'remove', 'uninstall', 'run', 'search', 'update', 'upgrade') – Daniel dos Santos Mar 15 '19 at 22:00
2 Answers
2
It sounds like you have an anaconda environment. To install packages to your python environment in anaconda, follow the documentation.
Basically try installing packages like conda install -n Abitt scipy
. After installing the package, it should show up in your project interpreter settings.

Aaron Arima
- 164
- 1
- 11
-
I tried both conda install -n Abitt pyttsx3 and speech_recognition and both returned **PackagesNotFoundError: The following packages are not available from current channels:** However conda install -n Abitt scipy did work. – Daniel dos Santos Mar 15 '19 at 22:19
-
1try installing pip and then using pip to install the packages `conda install -n Abitt pip` and then activate the env `conda activate Abitt`. Then try using pip to install `pip install pyttsx3` – Aaron Arima Mar 15 '19 at 22:27
1
I actually just had a very similar issue. if you installed them sucessfully and can see that they appear in the terminal, then go to file -> settings -> Project Interpreter and from here click on the plus (+) icon on the right. You won't see the modules until you click the (+) icon. From there, simply search the modules and they should appear and give you the option to add them. This worked for me, so please let me know if it does for you too!

AndreiF
- 21
- 5
-
I did click on the +. The problem is that neither speech_recognition nor pyttsx3 can be found there when I look them up. – Daniel dos Santos Mar 15 '19 at 21:27
-
1@DanieldosSantos Hmm. I am unsure then. I used the information from https://stackoverflow.com/questions/31235376/pycharm-doesnt-recognise-installed-module to get mine to work. Sorry, I really wish I could be more help but this is all fairly new to me – AndreiF Mar 15 '19 at 21:32