In command line python -c 'import flask'
Output:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/ubuntu/.local/lib/python2.7/site-packages/flask/__init__.py", line 17, in <module>
from werkzeug.exceptions import abort
File "/home/ubuntu/.local/lib/python2.7/site-packages/werkzeug/__init__.py", line 151, in <module>
__import__('werkzeug.exceptions')
File "/home/ubuntu/.local/lib/python2.7/site-packages/werkzeug/exceptions.py", line 67, in <module>
from werkzeug._internal import _get_environ
File "/home/ubuntu/.local/lib/python2.7/site-packages/werkzeug/_internal.py", line 13, in <module>
import inspect
File "/usr/lib/python2.7/inspect.py", line 39, in <module>
import tokenize
File "/usr/lib/python2.7/tokenize.py", line 39, in <module>
COMMENT = N_TOKENS
NameError: name 'N_TOKENS' is not defined
How can I solve it?
Met this error in my flask project, although yesterday everything was fine.
Related
Traceback (most recent call last):
File "/data/user/0/ru.iiec.pydroid3/files/accomp_files/iiec_run/iiec_run.py", line 31, in <module>
start(fakepyfile,mainpyfile)
File "/data/user/0/ru.iiec.pydroid3/files/accomp_files/iiec_run/iiec_run.py", line 30, in start
exec(open(mainpyfile).read(), __main__.__dict__)
File "<string>", line 2, in <module>
File "/data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.9/site-packages/pywhatkit/__init__.py", line 16, in <module>
from pywhatkit.whats import (
File "/data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.9/site-packages/pywhatkit/whats.py", line 7, in <module>
import pyautogui as pg
File "/data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.9/site-packages/pyautogui/__init__.py", line 249, in <module>
import mouseinfo
File "/data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.9/site-packages/mouseinfo/__init__.py", line 223, in <module>
_display = Display(os.environ['DISPLAY'])
File "/data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.9/os.py", line 679, in __getitem__ raise KeyError(key) from None
KeyError: 'DISPLAY'
[Program finished]
import pywhatkit
pywhatkit.sendwhatmsg ("+9195352xxxx5", "Hello ", 14, 10)
pywhatkit not getting imported in this 2 line program. Above is the error message.
[notebook-0 workspace]$ gpustat
Traceback (most recent call last):
File "/home/sandbox/.local/bin/gpustat", line 5, in <module>
from gpustat import main
File "/home/sandbox/.local/lib/python3.7/site-packages/gpustat/__init__.py", line 7, in <module>
from .core import GPUStat, GPUStatCollection
File "/home/sandbox/.local/lib/python3.7/site-packages/gpustat/core.py", line 31, in <module>
class GPUStat(object):
File "/home/sandbox/.local/lib/python3.7/site-packages/gpustat/core.py", line 161, in GPUStat
term=Terminal(),
File "/home/sandbox/.local/lib/python3.7/site-packages/blessings/__init__.py", line 98, in __init__
self._init_descriptor)
_curses.error: setupterm: could not find terminfo database
When I run gpustat in my terminal, I get the above output.
I'm trying to install EC2_API on openstack ( newton )
I've got this problem ?
now the cloud is down : the problem is in every log
Please enter the password for the 'root' MySQL user:
Verified connectivity to MySQL.
Creating 'ec2api' database.
Traceback (most recent call last):
File "/usr/bin/pip", line 9, in <module>
from pip import main
File "/usr/lib/python2.7/dist-packages/pip/__init__.py", line 13, in <module>
from pip.exceptions import InstallationError, CommandError, PipError
File "/usr/lib/python2.7/dist-packages/pip/exceptions.py", line 6, in <module>
from pip._vendor.six import iteritems
File "/usr/lib/python2.7/dist-packages/pip/_vendor/__init__.py", line 64, in <module>
vendored("cachecontrol")
File "/usr/lib/python2.7/dist-packages/pip/_vendor/__init__.py", line 36, in vendored
__import__(modulename, globals(), locals(), level=0)
File "/usr/share/python-wheels/CacheControl-0.11.5-py2.py3-none-any.whl/cachecontrol/__init__.py", line 9, in <module>
File "/usr/share/python-wheels/CacheControl-0.11.5-py2.py3-none-any.whl/cachecontrol/wrapper.py", line 1, in <module>
File "/usr/share/python-wheels/CacheControl-0.11.5-py2.py3-none-any.whl/cachecontrol/adapter.py", line 3, in <module>
File "/usr/share/python-wheels/requests-2.9.1-py2.py3-none-any.whl/requests/__init__.py", line 53, in <module>
File "/usr/share/python-wheels/urllib3-1.13.1-py2.py3-none-any.whl/urllib3/contrib/pyopenssl.py", line 54, in <module>
File "/usr/lib/python2.7/dist-packages/OpenSSL/__init__.py", line 8, in <module>
from OpenSSL import rand, crypto, SSL
File "/usr/lib/python2.7/dist-packages/OpenSSL/SSL.py", line 112, in <module>
SSL_ST_INIT = _lib.SSL_ST_INIT
AttributeError: 'module' object has no attribute 'SSL_ST_INIT'
I am a windows user. I used the command pip install requests to have requests installed, and I also typedpip install urllib3 to have urllib3 installed. However, I am not able to run this code: from requests import request. I got a error like this:
Traceback (most recent call last):
File "D:\Python\lib\site-packages\requests-2.13.0-py3.5.egg\requests\packages\__init__.py", line 27, in <module>
from . import urllib3
File "D:\Python\lib\site-packages\requests-2.13.0-py3.5.egg\requests\packages\urllib3\__init__.py", line 8, in <module>
from .connectionpool import (
File "D:\Python\lib\site-packages\requests-2.13.0-py3.5.egg\requests\packages\urllib3\connectionpool.py", line 11, in <module>
from .exceptions import (
File "D:\Python\lib\site-packages\requests-2.13.0-py3.5.egg\requests\packages\urllib3\exceptions.py", line 2, in <module>
from .packages.six.moves.http_client import (
File "D:\Python\lib\site-packages\requests-2.13.0-py3.5.egg\requests\packages\urllib3\packages\six.py", line 203, in load_module
mod = mod._resolve()
File "D:\Python\lib\site-packages\requests-2.13.0-py3.5.egg\requests\packages\urllib3\packages\six.py", line 115, in _resolve
return _import_module(self.mod)
File "D:\Python\lib\site-packages\requests-2.13.0-py3.5.egg\requests\packages\urllib3\packages\six.py", line 82, in _import_module
__import__(name)
File "D:\Python\lib\http\client.py", line 71, in <module>
import email.parser
File "F:\eclipse\workspace\Overseascredit\email.py", line 1, in <module>
from requests import request
ImportError: cannot import name 'request'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "F:\eclipse\workspace\Overseascredit\email.py", line 1, in <module>
from requests import request
File "D:\Python\lib\site-packages\requests-2.13.0-py3.5.egg\requests\__init__.py", line 60, in <module>
from .packages.urllib3.exceptions import DependencyWarning
File "D:\Python\lib\site-packages\requests-2.13.0-py3.5.egg\requests\packages\__init__.py", line 29, in <module>
import urllib3
File "D:\Python\lib\site-packages\urllib3\__init__.py", line 8, in <module>
from .connectionpool import (
File "D:\Python\lib\site-packages\urllib3\connectionpool.py", line 11, in <module>
from .exceptions import (
File "D:\Python\lib\site-packages\urllib3\exceptions.py", line 2, in <module>
from .packages.six.moves.http_client import (
File "D:\Python\lib\site-packages\urllib3\packages\six.py", line 203, in load_module
mod = mod._resolve()
File "D:\Python\lib\site-packages\urllib3\packages\six.py", line 115, in _resolve
return _import_module(self.mod)
File "D:\Python\lib\site-packages\urllib3\packages\six.py", line 82, in _import_module
__import__(name)
File "D:\Python\lib\http\client.py", line 71, in <module>
import email.parser
File "F:\eclipse\workspace\Overseascredit\email.py", line 1, in <module>
from requests import request
ImportError: cannot import name 'request'
I saw a lot of answers saying that there is another file with duplicate name that occur this error, however, I searched through the fold, I did found one. I even reinstalled my python, but I still got this error. Please help me.
Try using
from requests import Request
instead of
from requests import request
Try to run an app on local machine through virtual environment. But run into this issues related to libssl. Have libssl.1.0.0.dylib in the reference folder so I don't know why it cannot find the method. Really appreciate anyone can give me a direction.
Traceback (most recent call last):
File "app.py", line 4, in <module>
from traffic_analytics import traffic_analytics
File "/Users/zhehaozhou/Documents/Development/giq-analytics/dashboard-x/webapp/traffic_analytics.py", line 12, in <module>
from traffic import download_ga_data as ga_downloader
File "/Users/zhehaozhou/Documents/Development/giq-analytics/dashboard-x/webapp/traffic/download_ga_data.py", line 13, in <module>
from ga import GoogleAnalytics
File "/Users/zhehaozhou/Documents/Development/giq-analytics/dashboard-x/webapp/traffic/ga.py", line 8, in <module>
from apiclient import errors
File "/Users/zhehaozhou/anaconda/envs/virtualZhehao2/lib/python2.7/site-packages/apiclient/__init__.py", line 19, in <module>
from googleapiclient import discovery
File "/Users/zhehaozhou/anaconda/envs/virtualZhehao2/lib/python2.7/site-packages/googleapiclient/discovery.py", line 66, in <module>
from oauth2client.client import GoogleCredentials
File "/Users/zhehaozhou/anaconda/envs/virtualZhehao2/lib/python2.7/site-packages/oauth2client/client.py", line 46, in <module>
from oauth2client import crypt
File "/Users/zhehaozhou/anaconda/envs/virtualZhehao2/lib/python2.7/site-packages/oauth2client/crypt.py", line 40, in <module>
from OpenSSL import crypto
File "/Users/zhehaozhou/anaconda/envs/virtualZhehao2/lib/python2.7/site-packages/OpenSSL/__init__.py", line 8, in <module>
from OpenSSL import rand, crypto, SSL
File "/Users/zhehaozhou/anaconda/envs/virtualZhehao2/lib/python2.7/site-packages/OpenSSL/rand.py", line 11, in <module>
from OpenSSL._util import (
File "/Users/zhehaozhou/anaconda/envs/virtualZhehao2/lib/python2.7/site-packages/OpenSSL/_util.py", line 7, in <module>
binding = Binding()
File "/Users/zhehaozhou/anaconda/envs/virtualZhehao2/lib/python2.7/site-packages/cryptography/hazmat/bindings/openssl/binding.py", line 114, in __init__
self._ensure_ffi_initialized()
File "/Users/zhehaozhou/anaconda/envs/virtualZhehao2/lib/python2.7/site-packages/cryptography/hazmat/bindings/openssl/binding.py", line 126, in _ensure_ffi_initialized
cls._modules,
File "/Users/zhehaozhou/anaconda/envs/virtualZhehao2/lib/python2.7/site-packages/cryptography/hazmat/bindings/utils.py", line 31, in load_library_for_binding
lib = ffi.verifier.load_library()
File "/Users/zhehaozhou/anaconda/envs/virtualZhehao2/lib/python2.7/site-packages/cffi/verifier.py", line 97, in load_library
return self._load_library()
File "/Users/zhehaozhou/anaconda/envs/virtualZhehao2/lib/python2.7/site-packages/cffi/verifier.py", line 207, in _load_library
return self._vengine.load_library()
File "/Users/zhehaozhou/anaconda/envs/virtualZhehao2/lib/python2.7/site-packages/cffi/vengine_cpy.py", line 153, in load_library
raise ffiplatform.VerificationError(error)
cffi.ffiplatform.VerificationError: importing '/Users/zhehaozhou/anaconda/envs/virtualZhehao2/lib/python2.7/site-packages/cryptography/_Cryptography_cffi_f3e4673fx399b1113.so': dlopen(/Users/zhehaozhou/anaconda/envs/virtualZhehao2/lib/python2.7/site-packages/cryptography/_Cryptography_cffi_f3e4673fx399b1113.so, 2): Symbol not found: _SSLv2_client_method
Referenced from: /Users/zhehaozhou/anaconda/envs/virtualZhehao2/lib/python2.7/site-packages/cryptography/_Cryptography_cffi_f3e4673fx399b1113.so
Expected in: /usr/lib/libssl.1.0.0.dylib