Navigation

    Quantiacs Community

    • Register
    • Login
    • Search
    • Categories
    • News
    • Recent
    • Tags
    • Popular
    • Users
    • Groups

    pycharm and virtual environments

    Support
    2
    2
    207
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • N
      Nikos84 last edited by

      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!

      1 Reply Last reply Reply Quote 0
      • support
        support last edited by support

        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":

        238da5ca-9bf9-40fb-abed-5cd96364e775-image.png

        Ensure that "Python version" == 3.7.

        If you see
        73987d80-ac01-4d2e-ab97-27bb1ae208bf-image.png
        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.

        f8fa3f12-d226-4bfa-86f6-ccad8185c0b3-image.png


        For me, it is working. I think it will suit you too.

        Regards.

        1 Reply Last reply Reply Quote 0
        • First post
          Last post
        Powered by NodeBB | Contributors
        • Documentation
        • About
        • Career
        • My account
        • Privacy policy
        • Terms and Conditions
        • Cookies policy
        Home
        Copyright © 2014 - 2021 Quantiacs LLC.
        Powered by NodeBB | Contributors