Installing in Arch Linux

582 views
Skip to first unread message

Federico Barabas

unread,
Oct 9, 2013, 6:21:02 PM10/9/13
to spyd...@googlegroups.com
Hi everyone!

I use Arch Linux. I installed spyder 2.3.0dev6 from source because building from AUR failed for me. It runs fine but it gets into Python 2.7 mode. How can I use it with Python 3? I know this version supports it.

thank you,
Federico

Carlos Córdoba

unread,
Oct 10, 2013, 9:21:45 AM10/10/13
to spyd...@googlegroups.com
Hi Federico,

If you installed Spyder from source, I guess you ran

python setup.py install

to do it. But to install it with Python 3 you need to run

python3 setup.py install

If this doesn't work, another thing you can do is to change the default interpreter to point to Python 3. For that you have to open

/usr/local/bin/spyder

and change its first line to point to it.

Hope this helps,
Carlos

El 09/10/13 17:21, Federico Barabas escribió:
--
You received this message because you are subscribed to the Google Groups "spyder" group.
To unsubscribe from this group and stop receiving emails from it, send an email to spyderlib+...@googlegroups.com.
To post to this group, send email to spyd...@googlegroups.com.
Visit this group at http://groups.google.com/group/spyderlib.
For more options, visit https://groups.google.com/groups/opt_out.

David Verelst

unread,
Oct 10, 2013, 5:53:50 PM10/10/13
to spyder
Hi Federico,

I am using the spyder-hg package from the AUR on Arch Linux, and almost rebuild the package on a daily basis. Why is your build failing, do you have any useful error messages?
Remember that on Arch Linux the default Python installation is version 3. So python refers to python3 and python2 to python2. For installing spyder directly from source for Python 3 would be:
python setup.py install.

Regards,
David

Federico Barabas

unread,
Oct 11, 2013, 4:05:48 PM10/11/13
to spyd...@googlegroups.com
Hi! Thank you for your answers

Exactly, in Arch the python command means python3. This is way I get:

$ python setup.py install
running install
running build
running build_py
running build_scripts
running build_doc
Running Sphinx v1.1.3
loading pickled environment... done
building [html]: targets for 18 source files that are out of date
updating environment: 0 added, 0 changed, 0 removed
looking for now-outdated files... none found
preparing documents... done
Traceback (most recent call last):                                              
  File "setup.py", line 224, in <module>
    cmdclass=CMDCLASS)
  File "/usr/lib/python3.3/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/usr/lib/python3.3/distutils/dist.py", line 917, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python3.3/distutils/dist.py", line 936, in run_command
    cmd_obj.run()
  File "/usr/lib/python3.3/distutils/command/install.py", line 569, in run
    self.run_command('build')
  File "/usr/lib/python3.3/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/usr/lib/python3.3/distutils/dist.py", line 936, in run_command
    cmd_obj.run()
  File "/usr/lib/python3.3/distutils/command/build.py", line 126, in run
    self.run_command(cmd_name)
  File "/usr/lib/python3.3/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/usr/lib/python3.3/distutils/dist.py", line 936, in run_command
    cmd_obj.run()
  File "setup.py", line 105, in run
    setup_command.BuildDoc.run(self)
  File "/usr/lib/python3.3/site-packages/sphinx/setup_command.py", line 143, in run
    app.build(force_all=self.all_files)
  File "/usr/lib/python3.3/site-packages/sphinx/application.py", line 204, in build
    self.builder.build_update()
  File "/usr/lib/python3.3/site-packages/sphinx/builders/__init__.py", line 196, in build_update
    'out of date' % len(to_build))
  File "/usr/lib/python3.3/site-packages/sphinx/builders/__init__.py", line 252, in build
    self.write(docnames, list(updated_docnames), method)
  File "/usr/lib/python3.3/site-packages/sphinx/builders/__init__.py", line 291, in write
    doctree = self.env.get_and_resolve_doctree(docname, self)
  File "/usr/lib/python3.3/site-packages/sphinx/environment.py", line 1230, in get_and_resolve_doctree
    doctree = self.get_doctree(docname)
  File "/usr/lib/python3.3/site-packages/sphinx/environment.py", line 1215, in get_doctree
    doctree = pickle.load(f)
AttributeError: 'str' object has no attribute '__dict__'

After this, I googled a bit and I found someone saying that it should be installed with python2, so I did $python2 setup.py install and it went through ok but spyder was always running in python2.7 mode and that was when I wrote to you.

Following Carlos' guide, I changed python2 to python in /usr/bin/spyder first line. Now spyder doesn't open, I get this error:

$ spyder
Traceback (most recent call last):
  File "/usr/bin/spyder", line 2, in <module>
    from spyderlib import start_app
  File "/usr/lib/python3.3/site-packages/spyderlib/start_app.py", line 12, in <module>
    from spyderlib.baseconfig import get_conf_path
  File "/usr/lib/python3.3/site-packages/spyderlib/baseconfig.py", line 183
    except IOError, _e:  # analysis:ignore
                  ^
SyntaxError: invalid syntax

Installing from AUR the package spyder-hg gets me to the same situation as doing the above :-(

David Verelst

unread,
Oct 12, 2013, 5:35:00 AM10/12/13
to spyder
The Python 3 build seems to fail because Sphinx in Python3 throws an error when building the documentation and I can replicate this on my system. I'll see if I can figure out a fix later during the weekend.

Regards,
David

David Verelst

unread,
Oct 12, 2013, 1:30:09 PM10/12/13
to spyder
I am not sure why PY3 Sphinx v1.1.3 fails to build the documentation for Spyder. The trace back didn't help me unfortunately. However, the problem is fixed for my by installing Sphinx from their repositories using the python-sphinx-hg package from the AUR. So, without any knowledge of what the problem is exactly, I would conclude that it is a Sphinx bug and it is already resolved upstream.

Can anybody else confirm that documentation for Spyder fails to build with Python 3 and Sphinx 1.1.3?

Regards,
David

Federico Barabas

unread,
Oct 13, 2013, 7:00:51 AM10/13/13
to spyd...@googlegroups.com
Hi David and Carlos

Thank you very much, thank's to you I'm now running spyder with python3.3. These are the steps I did following your guide (and in case someone is having the same problem and ends up here):

  1. Install python-sphinx-hg from AUR
  2. sudo rm -r /usr/lib/python3.3/site-packages/spyder* (this was needed to clean up the previous installation attempts)
  3. install spyder from source with sudo python setup.py install
  4. edit /usr/bin/spyder to change python2 to python3

thanks again!

Federico Barabas

unread,
Oct 13, 2013, 11:57:13 AM10/13/13
to spyd...@googlegroups.com
Just for the record, I installed the optional dependencies through pip and with rope I had a similar problem to the sphinx issue, which cause that spyder couldn't run. The solution was also the same: installing python-rope from AUR fixed it
Reply all
Reply to author
Forward
0 new messages