You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I used to import local python modules successfully but I fail it today. Here is my test example to import testing.py.
using PyCall
pushfirst!(PyVector(pyimport("sys")."path"), "")
@pyimport testing
It shows the following errors:
PyError (PyImport_ImportModule
The Python package testing could not be found by pyimport. Usually this means
that you did not install testing in the Python version being used by PyCall.
PyCall is currently configured to use the Python version at:
C:\Anaconda3\python.exe
and you should use whatever mechanism you usually use (apt-get, pip, conda,
etcetera) to install the Python package containing the testing module.
One alternative is to re-configure PyCall to use a different Python
version on your system: set ENV["PYTHON"] to the path/name of the python
executable you want to use, run Pkg.build("PyCall"), and re-launch Julia.
Another alternative is to configure PyCall to use a Julia-specific Python
distribution via the Conda.jl package (which installs a private Anaconda
Python distribution), which has the advantage that packages can be installed
and kept up-to-date via Julia. As explained in the PyCall documentation,
set ENV["PYTHON"]="", run Pkg.build("PyCall"), and re-launch Julia. Then,
To install the testing module, you can use `pyimport_conda("testing", PKG)`,
where PKG is the Anaconda package the contains the module testing,
or alternatively you can use the Conda package directly (via
`using Conda` followed by `Conda.add` etcetera).
) <class 'ModuleNotFoundError'>ModuleNotFoundError("No module named 'testing'",)
pyimport(::String) at PyCall.jl:544
top-level scope at PyCall.jl:588
Any suggestion to solve it?
The text was updated successfully, but these errors were encountered:
I used to import local python modules successfully but I fail it today. Here is my test example to import testing.py.
It shows the following errors:
Any suggestion to solve it?
The text was updated successfully, but these errors were encountered: