Forum Navigation
You need to log in to create posts and topics.

install python module by conda, but cannot import

Hi,

I create a conda environment 'ovito'. The python version in it is 3.8.10. I install the 'ovito python module' in this environment successfully. However, when I enter to the python interpreter, I cannot import ovito. My system is WSL Ubuntu 18. How can I fix it? Thank you a lot!

 

Uploaded files:
  • 微信图片_20210607114918.png

Hi,

Your screenshot shows that the ovito conda package did not get installed, because it was already installed. Perhaps, when you installed it the first time, you accidentally installed this version of the ovito package from the wrong source channel. The ovito package from the conda-forge channel does not contain the OVITO Python module. Only our own version of the ovito package, from the channel http://conda.ovito.org, contains the Python module.

You can run conda list to see the list of installed packages in your active environment and which source channels they came from. If you notice that the ovito package was installed from the conda-forge channel, then uninstall it first and reinstall it again using the full conda install command, which makes sure it gets fetched from the right channel:

conda install --strict-channel-priority -c https://conda.ovito.org -c conda-forge ovito

-Alex

Thank you very much for your prompt reply. I solved the problem by following your method. Now, I can import 'ovito' module and run a simple test successfully. However, I meet a small notice. When I import 'ovito' module each time, the terminal will print the following message. Can I ignore this?

Thank you again!

Uploaded files:
  • 微信图片_20210607190714.png

You can safely ignore this warning message, yes. It's coming from the Qt framework used by OVITO.

There may be ways to solve the problem and make the message go away. I've searched for the message text online and found the following discussion, for example:

https://stackoverflow.com/questions/59790350/qstandardpaths-xdg-runtime-dir-not-set-defaulting-to-tmp-runtime-aadithyasb

Thank you very much! I fix it with your shared link. But the new warning is printed, ‘This plugin does not support createPlatformOpenGLContext!’. Anyway, I think I can safely ignore this warning message as you said, and I'll start to study 'ovito mudule'.

Thanks for your reply again!

新的OVITO微信频道!
New for our users in China: OVITO on WeChat 

Official OVITO WeChat channel operated by Foshan Diesi Technology Co., Ltd.