Closed phyxavier closed 5 years ago
Does this error also occur if you run
dephell venv run python app/main.py
or if you run the following?
dephell venv shell
python app/main.py
What is the content of the folder where you try to run the command?
output from above:
main ❯ dephell venv run python app/main.py
INFO running... (command=['python', 'app/main.py'])
Traceback (most recent call last):
File "app/main.py", line 10, in <module>
from app import __version__
ImportError: cannot import name '__version__' from 'app' (/Users/<user>/.local/share/dephell/venvs/<my_app>-IrrL/main/lib/python3.7/site-packages/app/__init__.py)
ERROR command failed (code=1)
Does the file app/__init__.py
inside your project have the variable __version__
defined?
it is as follows:
"""Example to demonstrate fastapi-usage."""
__version__ = '0.1.0'
Ok, then perhaps try to either run:
PYTHONPATH=. dephell venv run python app/main.py
or to first activate the shell with dephell venv shell
and the run PYTHONPATH=. python app/main.py
perhaps the pythonpath is not set correctly. Does this help?
it worked! Thanks.
Used this:
env PYTHONPATH=. python app/main.py
Great :) Thanks that you try this package.
Bootstrapped example app with following results
results in:
issue is as follows: