Install package with Pipenv

210 views Asked by At

I'm trying to use cryptography package in Python in virenv but VsCode error is " no module with this name : Crypt.py(script) and Pipfile are in the same directory

...my direcotry > pipenv install cryptography 
....>

crypt.py

from cryptography.fernet import Fernet 
key = Fernet.generate_key()
print(key)

error :

from cryptography.fernet import Fernet
ModuleNotFoundError: No module named 'cryptography'

pipfile:

[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true

[dev-packages]

[packages]
cryptography = "*"

[requires]
python_version = "3.8"
1

There are 1 answers

0
GProst On BEST ANSWER

Make sure you're running python within the virtual env you set up with Pipenv:

pipenv run python my_script.py