running python-jl always leads to julia import error
- Dominant language
- Python
- Stars
- 893
- Forks
- 101
- PR merge metrics
- No merged PRs in 30d
Description
For more detailed background, see my [StackOverFlow question](https://stackoverflow.com/questions/53620852/unable-to-use-pyjulia-with-julia-1-0-and-conda-python-3-6).
I've followed the directions outlined in the readme.
1. I've installed Julia and added `julia` to my path
2. I've installed `PyCall.jl`
3. I've installed `PyJulia` using `python3 -m pip install julia`. This installs pyjulia into my current conda environment's python as well as `python-jl`.
Now, if I try to the example test `python-jl -c 'from julia.Base import banner; banner()'`, I get the following error.
```ERROR: PyError (PyImport_ImportModule
The Python package julia could not be found by pyimport. Usually this means
that you did not install julia in the Python version being used by PyCall.
PyCall is currently configured to use the Julia-specific Python distribution
installed by the Conda.jl package. To install the julia module, you can
use `pyimport_conda("julia", PKG)`, where PKG is the Anaconda
package the contains the module julia, or alternatively you can use the
Conda package directly (via `using Conda` followed by `Conda.add` etcetera).
Alternatively, if you want to use a different Python distribution on your
system, such as a system-wide Python (as opposed to the Julia-specific Python),
you can re-configure PyCall with that Python. As explained in the PyCall
documentation, set ENV["PYTHON"] to the path/name of the python executable
you want to use, run Pkg.build("PyCall"), and re-launch Julia.
)
ModuleNotFoundError("No module named 'julia'")
Stacktrace:
[1] pyimport(::String) at /Users/austin/.julia/packages/PyCall/0jMpb/src/PyCall.jl:486
[2] top-level scope at none:0
```
Based off of this, I need to install the PyJulia package julia on to the Julia distribution of Python. There seems to be a hint on how to do this from within Julia using `pyimport_conda("julia", PKG)` but it's not clear what is meant by PKG...
> where PKG is the Anaconda package the contains the module julia
I've tried the following in Julia to no avail
```
pyimport_conda("julia", "pyjulia")
pyimport_conda("julia", "julia")
Conda.add("julia")
```
All of these result in an error of not being able to find the respective package in the current `julia` channel.
For what it's worth, I think this shows that PyCall is using the Julia exclusive python distribution
`PyCall.libpython` returns `"/Users/austin/.julia/conda/3/lib/libpython3.7m.dylib"`
From what I can tell, I've followed the instructions and something else, possible with pyjulia, is causing the problem.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.