I'm installing package whl
with pip
in virtual enviorment.
PS C:UsersProject> .venv37Scriptsactivate
(venv37) PS C:UsersProject> pip install .vtk-9.0.1-cp37-cp37m-win_amd64.whl
Processing c:usersprojectvtk-9.0.1-cp37-cp37m-win_amd64.whl
Installing collected packages: vtk
Successfully installed vtk-9.0.1
and import works.
(venv37) PS C:UsersProject> python
Python 3.7.4 (default, Aug 9 2019, 18:34:13) [MSC v.1915 64 bit (AMD64)] :: Anaconda, Inc. on win32
Warning:
This Python interpreter is in a conda environment, but the environment has
not been activated. Libraries may fail to load. To activate this environment
please see https://conda.io/activation
Type "help", "copyright", "credits" or "license" for more information.
>>> import vtk
>>> exit()
(venv37) PS C:UsersProject> deactivate
Now I try to execute it from Python Interpreter in venv.
PS C:UsersProject> .venv37Scriptsactivate
(venv37) PS C:UsersProject> .venv37Scriptspython.exe
Python 3.7.8 (tags/v3.7.8:4b47a5b6ba, Jun 28 2020, 08:53:46) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import vtk
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'vtk'
>>>
And it doesn't work. What is my mistake?
question from:
https://stackoverflow.com/questions/65918477/import-package-doesnt-work-in-venv-when-executing-with-python-exe 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…