简体   繁体   中英

why i am not able to import python module

whenever i am trying to import a module and and run the code it is getting stuck.

xx.py"
k
k
Traceback (most recent call last):
  File "bit_generator.pyx", line 40, in numpy.random.bit_generator
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/secrets.py", line 19, in <module>
    from random import SystemRandom
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/random.py", line 49, in <module>
    from math import log as _log, exp as _exp, pi as _pi, e as _e, ceil as _ceil
ImportError: cannot import name 'log' from 'math' (/Users/showrov/Desktop/Codeforces/math.py)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/showrov/Desktop/Codeforces/xxx.py", line 1, in <module>
    import numpy
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/numpy/__init__.py", line 161, in <module>
    from . import random
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/numpy/random/__init__.py", line 180, in <module>
    from . import _pickle
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/numpy/random/_pickle.py", line 1, in <module>
    from .mtrand import RandomState
  File "mtrand.pyx", line 1, in init numpy.random.mtrand
  File "bit_generator.pyx", line 43, in init numpy.random.bit_generator
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/random.py", line 49, in <module>
    from math import log as _log, exp as _exp, pi as _pi, e as _e, ceil as _ceil
ImportError: cannot import name 'log' from 'math' (/Users/showrov/Desktop/Codeforces/math.py)[enter image description here][1]

Make sure you have installed the modules: you can do so by running in the vs code terminal:

pip install numpy
pip install discord.py

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