-
-
Notifications
You must be signed in to change notification settings - Fork 43
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
Gett KeyError: 'scale' from GitHub example #65
Comments
It's failing at
|
Also, it's problematic that you have both import julia
julia.install() Its output may tell us something useful, even if it fails. |
Thank you for responding to my posting so quickly.
The command /Users/user/opt/anaconda3/bin/python -c "import
matplotlib.pyplot as plt" works fine.
The command python-jl -c "import matplotlib.pyplot as plt" fails as follows:
(base) user@Samuels-Mac-Pro ~ % python-jl -c "import matplotlib.pyplot
as plt"
┌ Warning: `getindex(o::PyObject, s::Symbol)` is deprecated in favor of
dot overloading (`getproperty`) so elements should now be accessed as
e.g. `o.s` instead of `o[:s]`.
│ caller = top-level scope at none:4
└ @ Core none:4
Traceback (most recent call last):
File
"/Users/user/opt/anaconda3/lib/python3.7/site-packages/julia/pseudo_python_cli.py",
line 308, in main
python(**vars(ns))
File
"/Users/user/opt/anaconda3/lib/python3.7/site-packages/julia/pseudo_python_cli.py",
line 52, in python
exec(command, scope)
File "<string>", line 1, in <module>
File
"/Users/user/opt/anaconda3/lib/python3.7/site-packages/matplotlib/pyplot.py",
line 40, in <module>
from matplotlib.figure import Figure, figaspect
File
"/Users/user/opt/anaconda3/lib/python3.7/site-packages/matplotlib/figure.py",
line 20, in <module>
from matplotlib import backends, docstring, projections
File
"/Users/user/opt/anaconda3/lib/python3.7/site-packages/matplotlib/projections/__init__.py",
line 4, in <module>
from mpl_toolkits.mplot3d import Axes3D
File
"/Users/user/.julia/conda/3/lib/python3.7/site-packages/mpl_toolkits/mplot3d/__init__.py",
line 1, in <module>
from .axes3d import Axes3D
File
"/Users/user/.julia/conda/3/lib/python3.7/site-packages/mpl_toolkits/mplot3d/axes3d.py",
line 42, in <module>
class Axes3D(Axes):
File
"/Users/user/.julia/conda/3/lib/python3.7/site-packages/mpl_toolkits/mplot3d/axes3d.py",
line 52, in Axes3D
azim=-60, elev=30, zscale=None, sharez=None, proj_type='persp',
File
"/Users/user/opt/anaconda3/lib/python3.7/site-packages/matplotlib/docstring.py",
line 116, in dedent_interpd
return interpd(func)
File
"/Users/user/opt/anaconda3/lib/python3.7/site-packages/matplotlib/docstring.py",
line 40, in __call__
func.__doc__ %= self.params
KeyError: 'scale'
(base) user@Samuels-Mac-Pro ~ %
Any thoughts?
Sam Dupree.
…On May/04/2020 02:46:07, Takafumi Arakaki wrote:
It's failing at |import matplotlib.pyplot as plt|.
* Does |/Users/user/opt/anaconda3/bin/python -c "import
matplotlib.pyplot as plt"| work?
* Does |python-jl -c "import matplotlib.pyplot as plt"| work?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#65 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABEO35YDZ57EWAKBGAUJPOLRPZQC7ANCNFSM4MYPQ5ZA>.
|
Below is the result of re-building PyCall.jl:
(base) user@Samuels-Mac-Pro ~ % python
Python 3.7.6 (default, Jan 8 2020, 13:42:34)
[Clang 4.0.1 (tags/RELEASE_401/final)] :: Anaconda, Inc. on darwin
Type "help", "copyright", "credits" or "license" for more information.
>> import julia
>> julia.install()
[ Info: Julia version info
Julia Version 1.4.1
Commit 381693d3df* (2020-04-14 17:20 UTC)
Platform Info:
OS: macOS (x86_64-apple-darwin18.7.0)
uname: Darwin 19.4.0 Darwin Kernel Version 19.4.0: Wed Mar 4
22:28:40 PST 2020; root:xnu-6153.101.6~15/RELEASE_X86_64 x86_64 i386
CPU: Intel(R) Xeon(R) W-3235 CPU @ 3.30GHz:
speed user nice sys
idle irq
#1-24 3300 MHz 1202015 s 0 s 597363 s 25939154
s 0 s
Memory: 192.0 GB (150205.26171875 MB free)
Uptime: 115573.0 sec
Load Avg: 2.86669921875 2.6240234375 2.390625
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-8.0.1 (ORCJIT, skylake)
Environment:
JULIAPATH = /Applications/Julia-1.4.app/Contents/Resources/julia/
XPC_FLAGS = 0x0
TERM = xterm-color
HOME = /Users/user
PATH =
/Users/user/opt/anaconda3/bin:/Users/user/opt/anaconda3/condabin:/Library/Frameworks/Python.framework/Versions/3.7/bin:/usr/local/opt/gettext/bin:/Applications/Julia-1.4.app/Contents/Resources/julia/bin:/Applications/Julia-1.4.app/Contents/Resources/julia/bin/julia:/Users/user/boost_1_67_0_anaconda3/include/boost:/Users/user/boost_1_67_0_anaconda3/lib:/Applications/Absoft20.0/bin:/Applications/Absoft20.0/bin:/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/usr/local/share/dotnet:/opt/X11/bin:~/.dotnet/tools:/Library/Apple/usr/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Applications/Xamarin
Workbooks.app/Contents/SharedSupport/path-bin:/Users/user/oorb:/Users/user/oorb/main:/Users/user/cestam/adipack/bin:/Users/user/cestam/adipack/bin:/usr/local/sbin
MATLABPATH = /Users/user/ODTBX_6_5/mice/lib
MATLAB_HOME = /Applications/MATLAB_R2020a.app
AUTOBAYESHOME = /Users/user/AutoBayes/PN
JULIAPATH = /Applications/Julia-1.4.app/Contents/Resources/julia/
PYTHONPATH =
/Users/user/opt/anaconda3/bin/:/Volumes/Development/AstrophysicsLib
CONDA_BACKUP_JAVA_HOME =
JAVA_HOME = /Users/user/opt/anaconda3
CONDA_BACKUP_JAVA_LD_LIBRARY_PATH =
JAVA_LD_LIBRARY_PATH = /Users/user/opt/anaconda3/jre/lib/server
[ Info: Julia executable:
/Applications/Julia-1.4.app/Contents/Resources/julia/bin/julia
[ Info: Trying to import PyCall...
┌ Warning: PyCall is already installed. However, you may have trouble using
│ this Python executable because it is statically linked to libpython.
│
│ For more information, see:
│ https://pyjulia.readthedocs.io/en/latest/troubleshooting.html
│
│ Python executable:
│ /Users/user/opt/anaconda3/bin/python
│ Julia executable:
│ /Applications/Julia-1.4.app/Contents/Resources/julia/bin/julia
└ @ Main ~/opt/anaconda3/lib/python3.7/site-packages/julia/install.jl:74
>>
Hope this helps.
Sam Dupree.
…On May/04/2020 02:56:33, Takafumi Arakaki wrote:
Also, it's problematic that you have both |/Users/user/opt/anaconda3/|
and |/Users/user/.julia/conda/3/|. You can try re-build PyCall.jl by
import julia
julia.install()
Its output may tell us something useful, even if it fails.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#65 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABEO3544ITPLTNO3STIBJIDRPZRKDANCNFSM4MYPQ5ZA>.
|
It looks like you need to manually set up PyCall. See: https://github.com/JuliaPy/PyCall.jl#specifying-the-python-version In short: Open
|
I manually installed PyCall in Julia and it works now. Thank you.
Now I'd like to ask what was it that led you to have me manually install
PyCall? Nothing on diffeqpy's GitHub page would have led me to do that.
Once again thank you for your help. I greatly appreciated it. :-)
Sam Dupree.
…On May/04/2020 04:17:21, Takafumi Arakaki wrote:
It looks like you need to manually set up PyCall. See:
https://github.com/JuliaPy/PyCall.jl#specifying-the-python-version
In short: Open |julia| REPL and then run
|julia> ENV["PYTHON"] = "/Users/user/opt/anaconda3/bin/python" julia>
using Pkg julia> Pkg.build("PyCall") |
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#65 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABEO357ZYLSPELKQSQFSKFLRPZ2ZDANCNFSM4MYPQ5ZA>.
|
Yeah, we should probably add it to the README. |
I wrote Having said that, |
On final question, when I run the eaxmple as a Python script I get the
following message:
(base) user@Samuels-Mac-Pro ~ % python diffeqpy-ex-1.py
Traceback (most recent call last):
File "diffeqpy-ex-1.py", line 2, in <module>
from diffeqpy import de
File
"/Users/user/opt/anaconda3/lib/python3.7/site-packages/diffeqpy/de.py",
line 4, in <module>
from julia import Main
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 967, in
_find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 668, in _load_unlocked
File "<frozen importlib._bootstrap>", line 638, in
_load_backward_compatible
File
"/Users/user/opt/anaconda3/lib/python3.7/site-packages/julia/core.py",
line 246, in load_module
JuliaMainModule(self, fullname))
File
"/Users/user/opt/anaconda3/lib/python3.7/site-packages/julia/core.py",
line 148, in __init__
self._julia = loader.julia
File
"/Users/user/opt/anaconda3/lib/python3.7/site-packages/julia/core.py",
line 238, in julia
self.__class__.julia = julia = Julia()
File
"/Users/user/opt/anaconda3/lib/python3.7/site-packages/julia/core.py",
line 482, in __init__
raise UnsupportedPythonError(jlinfo)
julia.core.UnsupportedPythonError: It seems your Julia and PyJulia setup
are not supported.
Julia executable:
julia
Python interpreter and libpython used by PyCall.jl:
/Users/user/opt/anaconda3/bin/python
/Users/user/opt/anaconda3/lib/libpython3.7m.dylib
Python interpreter used to import PyJulia and its libpython.
/Users/user/opt/anaconda3/bin/python
/Users/user/opt/anaconda3/lib/libpython3.7m.dylib
Your Python interpreter "/Users/user/opt/anaconda3/bin/python"
is statically linked to libpython. Currently, PyJulia does not fully
support such Python interpreter.
The easiest workaround is to pass `compiled_modules=False` to `Julia`
constructor. To do so, first *reboot* your Python REPL (if this happened
inside an interactive session) and then evaluate:
>>> from julia.api import Julia
>>> jl = Julia(compiled_modules=False)
Another workaround is to run your Python script with `python-jl`
command bundled in PyJulia. You can simply do:
$ python-jl PATH/TO/YOUR/SCRIPT.py
See `python-jl --help` for more information.
For more information, see:
https://pyjulia.readthedocs.io/en/latest/troubleshooting.html
(base) user@Samuels-Mac-Pro ~ %
Would you elaborate a little concerning the first workaround discussed
above? It not clear to me if that workaround is applicable to my case or
applicable at all.
Sam Dupree.
…On May/04/2020 17:27:01, Takafumi Arakaki wrote:
what was it that led you to have me manually install PyCall?
I wrote |python-jl| so I could guess what's wrong. I think |python-jl|
and |julia.install| can print better error message or do a better
error recovery like you did manually here.
Having said that, |python-jl| is still a fundamentally flaky tool to
set up (as we observed in this issue; although it's nice when it
works). I feel like I should be spending time on solving this in a
more principled way (e.g., JuliaPy/PyCall.jl#612
<JuliaPy/PyCall.jl#612>), if I were to
tackle this problem.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#65 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABEO35YXCDAFNMN4VD67AZDRP4XKLANCNFSM4MYPQ5ZA>.
|
Did you try the workaround? That's the easiest way to check it if it works for you. Also, if you followed the link, there is an explanation: https://pyjulia.readthedocs.io/en/latest/troubleshooting.html#turn-off-compilation-cache. In particular:
By the way, please format your code snippet with tripe back quotes. It's hard to read. 😉 |
Fixed by PythonCall transition |
I'm attempting to run the example posted on the GitHub page for diffeqpy. I've installed diffeqpy successfully on a Mac Pro (2019) running Mac OS X 10.15.4 (Catalina). I'm running the Anaconda distribution for Python ver. 3.7.6.
The code I'm running is the following:
The problem I'm running into seems to be in Matplotlib:
The statement executing plt.plot seems to be okay, but I get KeyError: 'scale', which I do not understand.
Any suggestions?
Sam Dupree.
The text was updated successfully, but these errors were encountered: