Import Error Pythonnet Window 10
Import Error Pythonnet Window 10
I had virtual environment set up.
1) pip list
(py36) C:UsersUserDesktop>pip list
Package Version
--------------- ----------
certifi 2018.8.13
click 6.7
cycler 0.10.0
kiwisolver 1.0.1
matplotlib 2.2.3
mkl-fft 1.0.4
mkl-random 1.0.1
numpy 1.15.0
Pillow 5.2.0
pip 18.0
pyparsing 2.2.0
PyQt5 5.11.2
PyQt5-sip 4.19.12
python-dateutil 2.7.3
pythonnet 2.4.0.dev0
pytz 2018.5
scipy 1.1.0
setuptools 40.0.0
six 1.11.0
visbrain 0.4.2
vispy 0.5.3
wheel 0.31.1
wincertstore 0.2
2) path and pythonpath before python initialize.
string path = @"D:Anaconda3envspy36;" + Environment.GetEnvironmentVariable("PATH", EnvironmentVariableTarget.Machine);
Environment.SetEnvironmentVariable("PATH", path, EnvironmentVariableTarget.Process);
Environment.SetEnvironmentVariable("PYTHONHOME", @"D:Anaconda3envspy36", EnvironmentVariableTarget.Process);
// initialize python engine
PythonEngine.Initialize();
3) set Amaconda in %PATH%
4) python path
(py36) C:UsersUserDesktop>python --version
Python 3.6.6 :: Anaconda, Inc.
ReadMe works fine.
but when i typed like this in my C# program
using (Py.GIL())
// import vispy
dynamic myVispy = Py.Import("vispy");
Console.WriteLine("hi vispy");
error message belowPython.Runtime.PythonException: 'ModuleNotFoundError : No module named 'vispy''
Python.Runtime.PythonException: 'ModuleNotFoundError : No module named 'vispy''
stack trace :
Python.Runtime.PythonException
HResult=0x80131500
Message=ModuleNotFoundError : No module named 'vispy'
Source=Python.Runtime
StackTrace:
would like to know how to solve this ?
Thank You.
%PATH%
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
The third step looks wrong. Why would you set the root Anaconda environment into
%PATH%
?! Are you not using "py36" environment.– denfromufa
Aug 21 at 22:35