I'm currently using venv and gevent inside my python environment, and I can't seem to get it to work. Here's my stack trace:
Traceback (most recent call last):
File "C:\Users\Brian\AppData\Local\Programs\Python\Python35\lib\runpy.py", line 184, in _run_module_as_main
"__main__", mod_spec)
File "C:\Users\Brian\AppData\Local\Programs\Python\Python35\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "D:\Projects\sfe-giveaways\venv\lib\site-packages\disco\cli.py", line 12, in <module>
from gevent import monkey
File "D:\Projects\sfe-giveaways\venv\lib\site-packages\gevent\__init__.py", line 48, in <module>
import socket # pylint:disable=unused-import,useless-suppression
File "C:\Users\Brian\AppData\Local\Programs\Python\Python35\lib\socket.py", line 49, in <module>
import _socket
ImportError: DLL load failed: %1 is not a valid Win32 application.
I believe that I need a 32-bit version of gevent so it's compatible with venv, but I don't know how to install the 32-bit version. Thanks in advance.
Related
When I try to run any python code in debug mode using VScode, I got an error message saying:
42737 -- /home/<username>/Desktop/development/bopi/experiment_handler.py .vscode-server/extensions/ms-python.python-2022.4.0/pythonFiles/lib/python/debugpy/launcher 4
Traceback (most recent call last):
File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/home/<username>/.vscode-server/extensions/ms-python.python-2022.4.0/pythonFiles/lib/python/debugpy/__main__.py", line 43, in <module>
from debugpy.server import cli
File "/home/<username>/.vscode-server/extensions/ms-python.python-2022.4.0/pythonFiles/lib/python/debugpy/../debugpy/server/__init__.py", line 9, in <module>
import debugpy._vendored.force_pydevd # noqa
File "/home/<username>/.vscode-server/extensions/ms-python.python-2022.4.0/pythonFiles/lib/python/debugpy/../debugpy/_vendored/force_pydevd.py", line 37, in <module>
pydevd_constants = import_module('_pydevd_bundle.pydevd_constants')
File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
File "/home/<username>/.vscode-server/extensions/ms-python.python-2022.4.0/pythonFiles/lib/python/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_constants.py", line 362, in <module>
from _pydev_bundle._pydev_saved_modules import thread, threading
File "/home/<username>/.vscode-server/extensions/ms-python.python-2022.4.0/pythonFiles/lib/python/debugpy/_vendored/pydevd/_pydev_bundle/_pydev_saved_modules.py", line 97, in <module>
import queue as _queue; verify_shadowed.check(_queue, ['Queue', 'LifoQueue', 'Empty', 'Full', 'deque'])
File "/home/<username>/.vscode-server/extensions/ms-python.python-2022.4.0/pythonFiles/lib/python/debugpy/_vendored/pydevd/_pydev_bundle/_pydev_saved_modules.py", line 75, in check
raise DebuggerInitializationError(msg)
_pydev_bundle._pydev_saved_modules.DebuggerInitializationError: It was not possible to initialize the debugger due to a module name conflict.
i.e.: the module "queue" could not be imported because it is shadowed by:
/home/<username>/.local/lib/python2.7/site-packages/queue/__init__.pyc
Please rename this file/folder so that the original module from the standard library can be imported.
Deleting the init.pyc and init.py resulting with an error message about missing queue import.
Downgrading my Python extension in Visual Studio Code to v2022.2.1924087327 worked for me.
Elevating #Onur Berk's comment below as part of the answer:
Its is very easy to downgrade the python extension, just click 'extensions' and find the Python extension and select it. Rather than clicking 'uninstall' click the arrow next to it, this will give you an option to install another version
I am trying to open Jupyter Notebook in my Windows10 system.
I had python2.7 initially in my machine and I have installed python 3.8.
I have also installed Jupyter Notebook using pip install Jupyter
The installation has been successful, but when I try to access Jupyter Notebook, I get this error:
C:\Users\abhishek murahari>jupyter notebook
Traceback (most recent call last):
File "c:\python27\lib\runpy.py", line 174, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "c:\python27\lib\runpy.py", line 72, in _run_code
exec code in run_globals
File "C:\Python27\Scripts\jupyter-notebook.EXE\__main__.py", line 5, in <module>
File "c:\python27\lib\site-packages\notebook\notebookapp.py", line 47, in <module>
from zmq.eventloop import ioloop
File "c:\python27\lib\site-packages\zmq\__init__.py", line 47, in <module>
from zmq import backend
File "c:\python27\lib\site-packages\zmq\backend\__init__.py", line 40, in <module>
reraise(*exc_info)
File "c:\python27\lib\site-packages\zmq\backend\__init__.py", line 27, in <module>
_ns = select_backend(first)
File "c:\python27\lib\site-packages\zmq\backend\select.py", line 28, in select_backend
mod = __import__(name, fromlist=public_api)
File "c:\python27\lib\site-packages\zmq\backend\cython\__init__.py", line 6, in <module>
from . import (constants, error, message, context,
ImportError: DLL load failed: %1 is not a valid Win32 application.
Please help me with a solution.
Please check if the python version you are using is also 32 bit. If not then that could be the issue. You would be using a 64 bit python version.
I've been trying to install django, looked around the internet but couldn't find possible solution for this.
I have tried looking for solutions. Some solutions told me to install conflict checker for pip but it still did not work because nothing seems to be getting installed using 'pip' keyword. It even gives me error when I try to find out my pip version
python -m pip install django
PS C:\Users\Fahad> python -m pip install django
Traceback (most recent call last):
File "C:\Users\Fahad\AppData\Local\Programs\Python\Python37\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "C:\Users\Fahad\AppData\Local\Programs\Python\Python37\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Users\Fahad\AppData\Local\Programs\Python\Python37\lib\site-packages\pip\__main__.py", line 16, in <module>
from pip._internal import main as _main # isort:skip # noqa
File "C:\Users\Fahad\AppData\Local\Programs\Python\Python37\lib\site-packages\pip\_internal\__init__.py", line 19, in
from pip._vendor.urllib3.exceptions import DependencyWarning
ModuleNotFoundError: No module named 'pip._vendor.urllib3
PS C:\Users\Fahad> python -m pip --version
Traceback (most recent call last):
File "C:\Users\Fahad\AppData\Local\Programs\Python\Python37\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "C:\Users\Fahad\AppData\Local\Programs\Python\Python37\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Users\Fahad\AppData\Local\Programs\Python\Python37\lib\site-packages\pip\__main__.py", line 16, in <module>
from pip._internal import main as _main # isort:skip # noqa
File "C:\Users\Fahad\AppData\Local\Programs\Python\Python37\lib\site-packages\pip\_internal\__init__.py", line 19, in <module>
from pip._vendor.urllib3.exceptions import DependencyWarning
ModuleNotFoundError: No module named 'pip._vendor.urllib3'
So I tried downloading get-pip.py from here and hen I executed python get-pip.py then I tried re-installing django and it worked.
Trying to open a jupyter notebook file (.ipynb file)
with this command ipython notebook filename.ipynb then I am getting Below Error while using ipython..
Traceback (most recent call last):
File "c:\python\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "c:\python\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Python\Scripts\ipython.exe\__main__.py", line 5, in <module>
File "c:\python\lib\site-packages\IPython\__init__.py", line 55, in <module>
from .terminal.embed import embed
File "c:\python\lib\site-packages\IPython\terminal\embed.py", line 16, in
<module>
from IPython.terminal.interactiveshell import TerminalInteractiveShell
File "c:\python\lib\site-packages\IPython\terminal\interactiveshell.py",
line 18, in <module>
from prompt_toolkit.enums import DEFAULT_BUFFER, EditingMode
ModuleNotFoundError: No module named 'prompt_toolkit'
Just got the same problem.
The solution for me was to pip uninstall prompt-toolkit and pip install prompt-toolkit. This uninstalled v1.0.5 and installed v2.0.4.
Why I can't install pip with pypy3 -m ensurepip? I have unpacked PyPy from official package, and followed instructions at official docs but resulting in an error. Interpreter log is below.
Traceback (most recent call last):
File "D:\pypy3-v5.10.0-win32\lib-python\3\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "D:\pypy3-v5.10.0-win32\lib-python\3\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "D:\pypy3-v5.10.0-win32\lib-python\3\ensurepip\__main__.py", line 4, in <module>
ensurepip._main()
File "D:\pypy3-v5.10.0-win32\lib-python\3\ensurepip\__init__.py", line 209, in _main
default_pip=args.default_pip,
File "D:\pypy3-v5.10.0-win32\lib-python\3\ensurepip\__init__.py", line 116, in bootstrap
_run_pip(args + [p[0] for p in _PROJECTS], additional_paths)
File "D:\pypy3-v5.10.0-win32\lib-python\3\ensurepip\__init__.py", line 40, in _run_pip
import pip
File "C:\Users\user\AppData\Local\Temp\tmp5zq6hqua\pip-9.0.1-py2.py3-none-any.whl\pip\__init__.py", line 21, in <module>
File "C:\Users\user\AppData\Local\Temp\tmp5zq6hqua\pip-9.0.1-py2.py3-none-any.whl\pip\_vendor\requests\__init__.py", line 62, in <module>
File "C:\Users\user\AppData\Local\Temp\tmp5zq6hqua\pip-9.0.1-py2.py3-none-any.whl\pip\_vendor\requests\packages\__init__.py", line 27, in <module>
File "C:\Users\user\AppData\Local\Temp\tmp5zq6hqua\pip-9.0.1-py2.py3-none-any.whl\pip\_vendor\requests\packages\urllib3\__init__.py", line 8, in <module>
File "C:\Users\user\AppData\Local\Temp\tmp5zq6hqua\pip-9.0.1-py2.py3-none-any.whl\pip\_vendor\requests\packages\urllib3\connectionpool.py", line 101, in <module>
AttributeError: module 'errno' has no attribute 'EWOULDBLOCK'
The errno module on pypy3 on Windows (which is beta) is indeed incomplete. This has been fixed after the 5.10.0 release and will be included in the 5.10.1 release.
We build nightly zip files off the latest HEAD, available here. It would be great if you could try out the latest windows version and let us know on IRC at #pypy, or on the pypy-dev mailing list, or by filing an issue on our bitbucket issue tracker whether it works for you, so that we will not need to do a 5.10.2 bug release fix after the current one.