简体   繁体   中英

How to fix unsolved reference 'vPython' in PyCharm?

I want to code in VPython with Pycharm. I use the conda interpreter. But the keywords of Python are red underlined and it says: unsolved reference 'vPython' . I actually installed vPython and anaconda but it doesn't seem to recognize it. It even gives me the advice: install vPython when I press the red bulb. When I do so I get the error message:

PackagesNotFoundError: The following packages are not available from current channels:

Solving environment: ...working... failed

PackagesNotFoundError: The following packages are not available from current channels:

  • vpython

Current channels:

To search for alternate channels that may provide the conda package you're looking for, navigate to

https://anaconda.org

and use the search bar at the top of the page.

Anaconda doesn't include vpython AFAIK. I think you'll need to get it from PyPI. You can do this by calling pip install vpython in your shell (terminal application on Mac).

Before that, though, make sure pip is pointing to Anaconda's pip so that the packages are installed in Anaconda's site-packages. You can check this with which pip . If that path isn't the path to your Anaconda install, you'll have to update your PATH environment variable to point to Anaconda's pip . This is system dependent, so we can't really help you much with this step (ie we don't know where your Anaconda installation is).

On Mac OSX, you can do export PATH="$PATH:/path/to/Anacondas/pip/directory" in order to set your PATH .

HTH, let me know if you have any questions by commenting below.

有关安装和使用vpython模块的详细信息,请参见vpython.org。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM