简体   繁体   中英

Getting a 'module not found' error after installing a package

I tried installing the deuces package in python using

python -m pip install deuces

which installed perfectly. But whenever I attempt to call upon the function, I get an error message:

Traceback (most recent call last): File "", line 1, in File "C:\\Python\\Anaconda\\lib\\site-packages\\deuces__init__.py", line 1, in from card import Card ModuleNotFoundError: No module named 'card'

Even though I can't find anything wrong with the module calling. Would someone be able to check what's going wrong here?

PS: I did read the post Import Error Python: No module named 'card' but found no solution.

在此处输入图片说明

It seems the package is using python 2 only relative imports here , which was removed py PEP 404 .

These should be changed to either douces.xxx or relative imports .xxx . Currently, your best hope would be to make a PR to fix this, or to fork the library and fix it yourself.

You are most likely trying to run this code in Python 3. Sadly the deuces module's page in the PyPI repository does not make it clear that the module currently only appears to support Python 2, under which the module imports perfectly.

Since it doesn't look like the module has received much attention lately, if you want to run it under Python 3 you may end up doing the port yourself. It doesn't look as though it would take too much work.

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