-
Notifications
You must be signed in to change notification settings - Fork 190
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do not run conda install
automagically (unless Conda.jl is used)
#580
Conversation
@@ -683,6 +674,12 @@ function pyimport_conda(modulename::AbstractString, condapkg::AbstractString, | |||
Pkg.build("PyCall") | |||
before trying again. | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error message should also suggest that the user run \"$aconda install -y $condapkg\"
manually
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did that below. Isn't it enough?:
Lines 680 to 681 in f1def60
To install $condapkg using $aconda, you can run the following command from your system shell: | |
$aconda install$options $condapkg |
return pyimport(modulename) | ||
if isempty(aconda) | ||
# Not in conda environment; show the error from `pyimport`. | ||
rethrow() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the case where it should say that PyCall was configured to use $python
and suggest configuring with Conda.jl if the user wants automatic installation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With #579 merged this rethrow()
should show the detailed error message from pyimport
:
Lines 461 to 482 in c45a076
msg = msg * """ | |
PyCall is currently configured to use the Python version at: | |
$python | |
and you should use whatever mechanism you usually use (apt-get, pip, conda, | |
etcetera) to install the Python package containing the $name 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 $name module, you can use `pyimport_conda("$(escape_string(name))", PKG)`, | |
where PKG is the Anaconda package the contains the module $name, | |
or alternatively you can use the Conda package directly (via | |
`using Conda` followed by `Conda.add` etcetera). | |
""" |
I guess it covers what you are saying?
fix #560