-1

I would like to use trading_ig 0.0.5 in some Python code I am writing. Can anyone tell me how to add this code to my library? I have run:

$ pip install trading_ig

But I still can't import when running code, for example:

from trading_ig import IGService

from trading_ig_config import config
jonrsharpe
  • 115,751
  • 26
  • 228
  • 437
Paul Young
  • 133
  • 2
  • 8
  • 2
    Are you sure you're using the same version of Python on the command line and within your PyCharm project (for example, if you set up a virtual environment, did you `activate` it on the command line)? Have you tried installing the package through the PyCharm GUI (or does it already appear in the list of installed packages)? – jonrsharpe May 18 '15 at 13:03
  • How do I find a list of installed packages? – Paul Young May 18 '15 at 13:08
  • 1
    It should already be there if you are using the correct interpreter for your project. – Padraic Cunningham May 18 '15 at 13:09
  • Ah ok I will check tonight Thanks – Paul Young May 18 '15 at 15:32

1 Answers1

0

It can be done by the following steps,

1) PyCharm > Preferences... > Project Interpreter > Python Interpreters

2) Click "Create Virtual Environment" and pick your base interpreter.

3) Click "Install" and install any packages you need. You can also add other repositories if the default ones do not contain required libraries. Another benefit is that you can see which libraries have newer version and can be updated.

Please refer: PyCharm and external libraries

Community
  • 1
  • 1
user3707514
  • 45
  • 1
  • 5