0

I installed the GraphLab by following the instructions here: https://turi.com/download/install-graphlab-create-command-line.html But when i try to import graphlab in pycharm im getting this error: No module named 'graphlab'. I tried to find the specifc environment in pycharm but i could only find Python 3.5 and Python 2.7.12. But the environment that graphlab was set up was Python 2.7.11. Any insights would be greatly appreaciated.

redwolf_cr7
  • 1,845
  • 4
  • 26
  • 30

2 Answers2

1

If you followed the tutorial, your Graplab library is wihtin a virtual environment. You need to tell PyCharm to use the correct interpreter for your code. Here is an explanation on how to add a local interpreter for a virtual environment: https://www.jetbrains.com/help/pycharm/2016.1/adding-existing-virtual-environment.html

molig
  • 314
  • 2
  • 6
  • Thank you. But I installed into Anaconda Python Environment. I did not create a virtual environment. – redwolf_cr7 Nov 29 '16 at 14:16
  • 1
    In that case you need to point PyCharm to the anaconda python interpreter. This is in the Anaconda installation folder. On Windows that would be somethin like C:\Users\xxx\Anaconda3\python.exe. You can do it the same way. Ctrl+Alt+S, Project:name, Project Interpreter, Add Local and then navigate to the anaconda python.exe. – molig Nov 29 '16 at 14:22
  • I tried that. But when i installed GraphLab, i mapped it to python 2.7.11. But im not able to find that specifc version. I only see Python 2.5, Python 2.7.12 and Python 3.5.1. I thought 2.7.12 should work. But even that is throwing the same error: No module named graphlab. – redwolf_cr7 Nov 29 '16 at 14:24
  • So let me get this straight: You installed Anaconda and want to use Graphlab in you Anaconda environment. If so: Did you install Graphlab with the conda command or with pip? – molig Nov 29 '16 at 14:28
  • I'm a noob at this whole Python thing :) I installed Anaconda and then installed GraphLab by following the instructions on the site - pip install --upgrade --no-cache-dir https://get.graphlab.com/GraphLab-Create/2.1/your registered email address here/your product key here/GraphLab-Create-License.tar.gz. I want to be able to use GraphLab on PyCharm so I can learn its functionalities etc. – redwolf_cr7 Nov 29 '16 at 14:32
  • 1
    Okay so I can recommend two things. First: You seem to have several python versions installed. If you don't need them get rid of them. Now if you know that you will need Anaconda, just install Anaconda with the latest Python 2.7, if you don't need Anaconda just install the latest Python 2.7. If you use Anaconda, try to install Graphlab via the conda command, instead of pip. A completely different option is to get a Docker container with everything set up, and create a remote interpreter in PyCharm, that runs your code in this container. – molig Nov 29 '16 at 14:37
  • Thanks molig. I will give it a shot. – redwolf_cr7 Nov 29 '16 at 14:41
0

@molig I have fixed this issue. I opened a new project in PyCharm and pointed the environment to the appropriate one, in this case to gl-env that i created while installing GraphLab. Thank you!

redwolf_cr7
  • 1,845
  • 4
  • 26
  • 30