AttributeError: Can't get attribute 'Session' on <module '__mp_main__' #1449
Unanswered
pscho
asked this question in
Potential Issue
Replies: 1 comment
-
the error is so weird, can you reproduce on a traditional virtualenv ? If not I'm afraid you should direct the question to Anaconda folks |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am running into the above issue on startup. I am running an Anaconda environment, however I've tried installing uvicorn in many ways both via pip and conda and the issue persists. I'm using it with FastAPI if that is somehow relevant.
Full stack trace:
paul@paul:~/rclone_gdrive/dev/AI/prototyping$ uvicorn state_server_2:app --reload
INFO: Will watch for changes in these directories: ['/home/paul/rclone_gdrive/dev/AI/prototyping']
INFO: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)
INFO: Started reloader process [28680] using watchgod
Process SpawnProcess-1:
Traceback (most recent call last):
File "/home/paul/anaconda3/envs/base37/lib/python3.7/multiprocessing/process.py", line 297, in _bootstrap
self.run()
File "/home/paul/anaconda3/envs/base37/lib/python3.7/multiprocessing/process.py", line 99, in run
self._target(*self._args, **self._kwargs)
File "/home/paul/anaconda3/envs/base37/lib/python3.7/site-packages/uvicorn/subprocess.py", line 76, in subprocess_started
target(sockets=sockets)
File "/home/paul/anaconda3/envs/base37/lib/python3.7/site-packages/uvicorn/server.py", line 60, in run
return asyncio.run(self.serve(sockets=sockets))
File "/home/paul/anaconda3/envs/base37/lib/python3.7/asyncio/runners.py", line 43, in run
return loop.run_until_complete(main)
File "uvloop/loop.pyx", line 1501, in uvloop.loop.Loop.run_until_complete
File "/home/paul/anaconda3/envs/base37/lib/python3.7/site-packages/uvicorn/server.py", line 67, in serve
config.load()
File "/home/paul/anaconda3/envs/base37/lib/python3.7/site-packages/uvicorn/config.py", line 458, in load
self.loaded_app = import_from_string(self.app)
File "/home/paul/anaconda3/envs/base37/lib/python3.7/site-packages/uvicorn/importer.py", line 21, in import_from_string
module = importlib.import_module(module_str)
File "/home/paul/anaconda3/envs/base37/lib/python3.7/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1006, in _gcd_import
File "", line 983, in _find_and_load
File "", line 967, in _find_and_load_unlocked
File "", line 677, in _load_unlocked
File "", line 728, in exec_module
File "", line 219, in _call_with_frames_removed
File "./state_server_2.py", line 2755, in
SERVER = Server() # Not in init only for easier development (context hints)
File "./state_server_2.py", line 72, in init
self.sessions: Dict[int, Session] = pickle.load(open(sessions_file_path, 'rb'))
AttributeError: Can't get attribute 'Session' on <module 'mp_main' from '/home/paul/anaconda3/envs/base37/bin/uvicorn'>
Any help is appreciated, thanks!
Beta Was this translation helpful? Give feedback.
All reactions