0

I tried to connect to my pen plotter using package pyaxidraw. I did install it successfully, upgraded as it says on their site by using commands:

python -m pip install https://cdn.evilmadscientist.com/dl/ad/public/AxiDraw_API.zip
python -m pip install https://cdn.evilmadscientist.com/dl/ad/public/AxiDraw_API.zip --upgrade --upgrade-strategy eager

It is visible in site-packages folder, the files are there. However, I cannot import it in my scripts - I get ModuleNotFoundError: No module named 'pyaxidraw'.

Path to site-packages is added to Path variable, as are many other paths to python. Tried installing it through python setup.py install and pip install . and nothing changed.

I also tried running the code below and it does work fine through terminal:

python -c "from pyaxidraw import axidraw; ad = axidraw.AxiDraw(); print(type(ad)); ad.interactive();  ad.connect(); ad.moveto(3, 5); ad.lineto(0, 0); ad.disconnect();"  

this makes my plotter move and plot just fine while in code it's still underlined in red because I can't import it.

But running the same code with "python3" instead of "python" in terminal gives me ModuleNotFoundError: No module named 'axidrawinternal'. It is said to work with Python 3.6 so I don't get what is happening.

How do I make python/Pycharm see this module so I can write scripts with it?

  • Welcome to SO! It looks like you have more than one Python installation. This is very easy to do without being aware of it. Since it works from the command line it is likely that `pip` is installing in one installation but PyCharm is using another. In PyCharm do Ctrl-Alt-S, Python interpreter to see what installation your project is using. Then navigate to the Scripts subfolder of that installation and issue the `pip` command from there. – BoarGules May 07 '22 at 19:19
  • Hey @BoarGules, thanks for the comment! I tried "import sys print(sys.version)" in terminal and in code and they both say exactly the same thing. Does it mean it's the same interpreter for pip and for a project? – Tomasz Jeliński May 07 '22 at 19:32
  • Ok, I installed it directly from option "install from disk" in PyCharm and it works, but still I don't know where did the error originated so will be glad if anyone shines some more light on the issue. – Tomasz Jeliński May 07 '22 at 21:00
  • They could be the same *version* but still different *installations*. Look at PyCharm ctrl-alt-S, Python interpreter and compare the location to what `pip --version` says. – BoarGules May 07 '22 at 21:39

0 Answers0