Skip to content
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

Plotting error after first installation #1

Closed
cyrilzakka opened this issue Nov 8, 2018 · 10 comments
Closed

Plotting error after first installation #1

cyrilzakka opened this issue Nov 8, 2018 · 10 comments

Comments

@cyrilzakka
Copy link

As a heads up some users might run into the following error when attempting to plot the performance of their agent when checking their installation the first time:

ImportError: Python is not installed as a framework. The Mac OS X backend will not be able to function correctly if Python is not installed as a framework. See the Python documentation for more information on installing Python as a framework on Mac OS X. Please either reinstall Python as a framework, or try one of the other backends. If you are using (Ana)Conda please install python.app and replace the use of 'python' with 'pythonw'. See 'Working with Matplotlib on OSX' in the Matplotlib FAQ for more information.

In order to overcome this, they can follow the steps outlined here

I have no clue if this only happens in a virtual environment (I was personally using a Conda environment) and didn't know where else to put it. Hope this helps!

@machinaut
Copy link

Thanks! This will probably be useful for other folks that find the same thing.

If there's something more we can do from the package side it'd be good to know that too.

(We ran into this issue during early testing, and its a pretty tricky one to tackle as a python package)

@jachiam
Copy link
Contributor

jachiam commented Nov 8, 2018

Fixing this within the next couple of days is on the todo list! Thanks for flagging!

@ggdupont
Copy link

ggdupont commented Nov 9, 2018

I have no clue if this only happens in a virtual environment (I was personally using a Conda environment) and didn't know where else to put it. Hope this helps!

It seems to be linked to the install of matplotlib done within conda env. Thanks for the fix!

@jachiam
Copy link
Contributor

jachiam commented Nov 15, 2018

Update: suuuuuper sorry for how long it's taking to give a real response on this. Handling it requires a partial installation doc rewrite which I haven't had time to do yet (because I want to verify that it'll work by tinkering on a mac computer I'm currently away from). Coming soon.

@cyrilzakka
Copy link
Author

Update: suuuuuper sorry for how long it's taking to give a real response on this. Handling it requires a partial installation doc rewrite which I haven't had time to do yet (because I want to verify that it'll work by tinkering on a mac computer I'm currently away from). Coming soon.

No worries man, there's really no hurry. A quick Google search should help anyone with a problem, or they can easily refer to the issues section of the repo. Enjoy your vacation! (I take it that's why you're away)

@zmpster
Copy link

zmpster commented Nov 17, 2018

I ran into this as well. After I ran:
conda install matplotlib
Now I get:

Plotting from...
==================================================

data/installtest/installtest_s0

==================================================
2018-11-17 09:15:42.633 python[56203:1063838] -[NSApplication _setup:]: unrecognized selector sent to instance 0x7f8440ca96f0
2018-11-17 09:15:42.636 python[56203:1063838] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSApplication _setup:]: unrecognized selector sent to instance 0x7f8440ca96f0'
*** First throw call stack:
(
	0   CoreFoundation                      0x00007fff3783723b __exceptionPreprocess + 171
	1   libobjc.A.dylib                     0x00007fff5eac8c76 objc_exception_throw + 48
	2   CoreFoundation                      0x00007fff378cfd94 -[NSObject(NSObject) doesNotRecognizeSelector:] + 132
	3   CoreFoundation                      0x00007fff377ad700 ___forwarding___ + 1456
	4   CoreFoundation                      0x00007fff377ad0c8 _CF_forwarding_prep_0 + 120
	5   libtk8.6.dylib                      0x000000011b84c31d TkpInit + 413
	6   libtk8.6.dylib                      0x000000011b7a417e Initialize + 2622
	7   _tkinter.cpython-36m-darwin.so      0x000000011b5cca16 _tkinter_create + 1174
	8   python                              0x000000010411e088 _PyCFunction_FastCallDict + 200
	9   python                              0x00000001041f4f4f call_function + 143
	10  python                              0x00000001041f2abf _PyEval_EvalFrameDefault + 46847
	11  python                              0x00000001041e6209 _PyEval_EvalCodeWithName + 425
	12  python                              0x00000001041f5b1c _PyFunction_FastCallDict + 364
	13  python                              0x000000010409c8b0 _PyObject_FastCallDict + 320
	14  python                              0x00000001040c3fe8 method_call + 136
	15  python                              0x00000001040a3efe PyObject_Call + 62
	16  python                              0x0000000104145385 slot_tp_init + 117
	17  python                              0x00000001041498c1 type_call + 241
	18  python                              0x000000010409c821 _PyObject_FastCallDict + 177
	19  python                              0x00000001040a4a67 _PyObject_FastCallKeywords + 327
	20  python                              0x00000001041f5048 call_function + 392
	21  python                              0x00000001041f2b6f _PyEval_EvalFrameDefault + 47023
	22  python                              0x00000001041f530c fast_function + 188
	23  python                              0x00000001041f4fac call_function + 236
	24  python                              0x00000001041f2abf _PyEval_EvalFrameDefault + 46847
	25  python                              0x00000001041e6209 _PyEval_EvalCodeWithName + 425
	26  python                              0x00000001041f5b1c _PyFunction_FastCallDict + 364
	27  python                              0x000000010409c8b0 _PyObject_FastCallDict + 320
	28  python                              0x00000001040c3fe8 method_call + 136
	29  python                              0x00000001040a3efe PyObject_Call + 62
	30  python                              0x00000001041f2cc0 _PyEval_EvalFrameDefault + 47360
	31  python                              0x00000001041e6209 _PyEval_EvalCodeWithName + 425
	32  python                              0x00000001041f53ba fast_function + 362
	33  python                              0x00000001041f4fac call_function + 236
	34  python                              0x00000001041f2abf _PyEval_EvalFrameDefault + 46847
	35  python                              0x00000001041e6209 _PyEval_EvalCodeWithName + 425
	36  python                              0x00000001041f53ba fast_function + 362
	37  python                              0x00000001041f4fac call_function + 236
	38  python                              0x00000001041f2b6f _PyEval_EvalFrameDefault + 47023
	39  python                              0x00000001041f530c fast_function + 188
	40  python                              0x00000001041f4fac call_function + 236
	41  python                              0x00000001041f2abf _PyEval_EvalFrameDefault + 46847
	42  python                              0x00000001041e6209 _PyEval_EvalCodeWithName + 425
	43  python                              0x000000010423ed4c PyRun_FileExFlags + 252
	44  python                              0x000000010423e224 PyRun_SimpleFileExFlags + 372
	45  python                              0x0000000104264d66 Py_Main + 3734
	46  python                              0x0000000104094929 main + 313
	47  libdyld.dylib                       0x00007fff5f6e2015 start + 1
	48  ???                                 0x0000000000000003 0x0 + 3
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Traceback (most recent call last):
  File "/anaconda3/envs/spinningup/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/anaconda3/envs/spinningup/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/Users/zpurdy/spinningup/spinup/run.py", line 225, in <module>
    subprocess.check_call(args, env=os.environ)
  File "/anaconda3/envs/spinningup/lib/python3.6/subprocess.py", line 291, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['python', '/Users/zpurdy/spinningup/spinup/utils/plot.py', 'data/installtest/installtest_s0']' died with <Signals.SIGABRT: 6>.

@zmpster
Copy link

zmpster commented Nov 20, 2018

Nevermind, this works now! conda install matplotlib basically messed things up more, and then I had to restart from scratch and follow the actual directions in original post. Thanks @cyrilzakka !!

@Kastier1
Copy link

Facing same problem using mkvirtualenv for my virtualenv

@JiamingXiao
Copy link

Nevermind, this works now! conda install matplotlib basically messed things up more, and then I had to restart from scratch and follow the actual directions in original post. Thanks @cyrilzakka !!

Hi, would you mind tell me how did you fix the 'NSInvalidArgumentException' problem? I got the same problem, and no idea how to fix it. Thanks.

@jachiam
Copy link
Contributor

jachiam commented Nov 4, 2019

So, at long last, to the best of my knowledge this issue is fixed by upgrading the matplotlib install to version 3.1.1. The setup.py file now requires this. I'm going to mark this closed for now. :)

@jachiam jachiam closed this as completed Nov 4, 2019
mahdinobar added a commit to mahdinobar/spinningup that referenced this issue Mar 28, 2024
mahdinobar added a commit to mahdinobar/spinningup that referenced this issue Mar 28, 2024
mahdinobar added a commit to mahdinobar/spinningup that referenced this issue Mar 28, 2024
mahdinobar added a commit to mahdinobar/spinningup that referenced this issue Mar 28, 2024
mahdinobar added a commit to mahdinobar/spinningup that referenced this issue Mar 28, 2024
mahdinobar added a commit to mahdinobar/spinningup that referenced this issue Mar 28, 2024
mahdinobar added a commit to mahdinobar/spinningup that referenced this issue Mar 28, 2024
mahdinobar added a commit to mahdinobar/spinningup that referenced this issue Mar 28, 2024
mahdinobar added a commit to mahdinobar/spinningup that referenced this issue Mar 28, 2024
mahdinobar added a commit to mahdinobar/spinningup that referenced this issue Mar 28, 2024
mahdinobar added a commit to mahdinobar/spinningup that referenced this issue May 3, 2024
mahdinobar added a commit to mahdinobar/spinningup that referenced this issue Sep 26, 2024
mahdinobar added a commit to mahdinobar/spinningup that referenced this issue Sep 26, 2024
mahdinobar added a commit to mahdinobar/spinningup that referenced this issue Sep 26, 2024
mahdinobar added a commit to mahdinobar/spinningup that referenced this issue Sep 26, 2024
mahdinobar added a commit to mahdinobar/spinningup that referenced this issue Sep 26, 2024
mahdinobar added a commit to mahdinobar/spinningup that referenced this issue Sep 26, 2024
mahdinobar added a commit to mahdinobar/spinningup that referenced this issue Sep 26, 2024
mahdinobar added a commit to mahdinobar/spinningup that referenced this issue Sep 26, 2024
mahdinobar added a commit to mahdinobar/spinningup that referenced this issue Sep 26, 2024
mahdinobar added a commit to mahdinobar/spinningup that referenced this issue Sep 26, 2024
mahdinobar added a commit to mahdinobar/spinningup that referenced this issue Sep 26, 2024
mahdinobar added a commit to mahdinobar/spinningup that referenced this issue Sep 27, 2024
mahdinobar added a commit to mahdinobar/spinningup that referenced this issue Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants