Zappa icon indicating copy to clipboard operation
Zappa copied to clipboard

Not recognizing virtaulenv created with pyenv.

Open iml1111 opened this issue 3 years ago • 0 comments

Context

If .python-version does not exist in the current path, the virtual environment of pyenv is not recognized.

Expected Behavior

> zappa update dev
Calling update for stage dev..
Downloading and installing dependencies..
...

Actual Behavior

# .python-version is not in that path, but pyenv works correctly.
> pwd
/Users/username/Documents/GitHub/myenv/myproject
> pyenv versions
* my-env (set by /Users/username/Documents/GitHub/my-env/.python-version)
...

> zappa update dev
Calling update for stage dev..
Error: Zappa requires an active virtual environment!
Learn more about virtual environments here: http://docs.python-guide.org/en/latest/dev/virtualenvs/

Possible Fix

In addition to detecting the .python-version file in the current path, you can check the current virtual environment by using the pyenv version command.

Steps to Reproduce

Your Environment

  • Zappa version used: 0.54.1
  • Operating System and Python version: 3.9.12
  • The output of pip freeze:
argcomplete==2.0.0
awscli==1.22.87
boto3==1.21.32
botocore==1.24.32
certifi==2021.10.8
cfn-flip==1.3.0
charset-normalizer==2.0.12
click==8.1.2
colorama==0.4.3
docutils==0.15.2
durationpy==0.5
Faker==13.3.4
Flask==2.1.1
flask-validation-extended==0.1.7
future==0.18.2
hjson==3.0.2
idna==3.3
importlib-metadata==4.11.3
itsdangerous==2.1.2
Jinja2==3.1.1
jmespath==1.0.0
kappa==0.6.0
MarkupSafe==2.1.1
placebo==0.9.0
pyasn1==0.4.8
python-dateutil==2.8.2
python-dotenv==0.20.0
python-slugify==6.1.1
PyYAML==5.4.1
requests==2.27.1
rsa==4.7.2
s3transfer==0.5.2
six==1.16.0
slack-sdk==3.15.2
text-unidecode==1.3
toml==0.10.2
tqdm==4.64.0
troposphere==4.0.0
urllib3==1.26.9
Werkzeug==2.1.1
wsgi-request-logger==0.4.6
zappa==0.54.1
zipp==3.8.0
  • Link to your project (optional): I don't think this is necessary.
  • Your zappa_settings.json: I don't think this is necessary.

iml1111 avatar May 10 '22 08:05 iml1111