pycharm and virtual environments
-
I use pycharm and I installed the quantiacs toolbox following the instructions I found on your page:
https://quantiacs.com/documentation/en/user_guide/local_development.html
However, the packages do not show up in pycharm!! Please help!
-
Hello.
I guess you are using a different python version and it can cause the problem.
There is an example of how I configured my project in pycharm. Try to follow my steps. I hope it will help you.
Start a new project and name it 'qntdev' and select "New Conda environment":
Ensure that "Python version" == 3.7.
If you see
then just remove the environment folder (just in case the previous env is broken).When you push the button "create", pycharm will initialize an empty environment with python=3.7.
Then open the command line and enter commands from the instruction:
conda create -n qntdev quantiacs-source::qnt conda-forge::ta-lib conda-forge::dash=1.18 python=3.7 # answer 'y' conda env config vars set -n qntdev API_KEY={your_api_key_here}
Next, close the command line and restart pycharm.
When pycharm finishes indexing, create a
strategy.py
, put the example code from the documentation to this file. Try to run it (right-click on the file -> 'run').On the first run you will see the error:
Please, specify the API_KEY.
It looks that pycharm don't see the env variable API_KEY, so just add these 2 lines to the head of the strategy:
import os os.environ['API_KEY'] = '{your_api_key_here}'
After that, start the file again.
For me, it is working. I think it will suit you too.
Regards.