Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError: cannot import name 'pystone' help #5

Closed
232824787 opened this issue Jan 8, 2018 · 9 comments
Closed

ImportError: cannot import name 'pystone' help #5

232824787 opened this issue Jan 8, 2018 · 9 comments

Comments

@232824787
Copy link

232824787 commented Jan 8, 2018

Traceback (most recent call last):
File "detect.py", line 27, in
import pybenchmark
File "/home/a/anaconda3/lib/python3.6/site-packages/pybenchmark/init.py", line 1, in
from .profile import profile, stats, kpystones, pystones
File "/home/a/anaconda3/lib/python3.6/site-packages/pybenchmark/profile.py", line 3, in
from test import pystone # native python-core "PYSTONE" Benchmark Program
ImportError: cannot import name 'pystone'

@232824787
Copy link
Author

reinstall python is ok

@xmfbit
Copy link

xmfbit commented Feb 2, 2018

@232824787 Hi, I have run into the same problem. Could you share your solution with more detail? The error of mine is as following:

Traceback (most recent call last):
  File "detect.py", line 33, in <module>
    import pybenchmark
  File "/home/me/anaconda2/envs/pyyolo/lib/python3.5/site-packages/pybenchmark/__init__.py", line 1, in <module>
    from .profile import profile, stats, kpystones, pystones
  File "/home/me/anaconda2/envs/pyyolo/lib/python3.5/site-packages/pybenchmark/profile.py", line 3, in <module>
    from test import pystone            # native python-core "PYSTONE" Benchmark Program
ImportError: cannot import name 'pystone'

@rosenfeldamir
Copy link

I ran into the same problem....

@diggerdu
Copy link

diggerdu commented Mar 3, 2018

Quick Fix: You can checkout a copy of pystone.py from the cpython github repository and copy it to a test directory that is present in your PYTHONPATH. Or you would copy it to a test directory in your python project's root (ugly way).

Perhaps Anaconda Python does not ship with a copy of the test module. This is a standard part of Python 2.7. Other times, users accidentally overwrite their Python standard library's test module with something else. You can try to use the Python version that is shipped with OS X instead. If that fails as well, then try to see which test module is being loaded, and go from there.

@xmfbit
Copy link

xmfbit commented Mar 4, 2018

@diggerdu Thanks for your kindness. I have solved the problem and forgot to write my solution down. My solution was just the same with your second solution and I indeed used Anaconda.

@jacktkk
Copy link

jacktkk commented Mar 7, 2018

@xmfbit
hi~ sorry for bothering u
the pystone.py I found only match python2,
so can u tell me where I can find the proper file(pystone.py)?
best wishes!

@diggerdu
Copy link

diggerdu commented Mar 7, 2018

@jacktkk
I post a gist

@jacktkk
Copy link

jacktkk commented Mar 7, 2018

@diggerdu thx~

@jacktkk
Copy link

jacktkk commented Mar 8, 2018

@diggerdu do you know how to fix the problem #8 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants