wxWidgets / Phoenix

wxPython's Project Phoenix. A new implementation of wxPython, better, stronger, faster than he was before.
http://wxpython.org/
2.33k stars 516 forks source link

Trouble installing wxPython on Linux following FAQ #1767

Closed moldach closed 4 years ago

moldach commented 4 years ago

When going to file an issue for wxPython there is a note:

For issues about building on Linux, please read this page before reporting it here: https://wxpython.org/blog/2017-08-17-builds-for-linux-with-pip/

Although, following these steps resulted in an error at Step 4. Here is the build.log from Step 4:

DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python$
Created temporary directory: /tmp/pip-ephem-wheel-cache-FafrTP
Created temporary directory: /tmp/pip-req-tracker-3FqrU4
Initialized build tracking at /tmp/pip-req-tracker-3FqrU4
Created build tracker: /tmp/pip-req-tracker-3FqrU4
Entered build tracker: /tmp/pip-req-tracker-3FqrU4
Created temporary directory: /tmp/pip-wheel-f5FV29
WARNING: Requirement 'wxPython-4.0.1.tar.gz' looks like a filename, but the file does not exist
Processing ./wxPython-4.0.1.tar.gz
  Created temporary directory: /tmp/pip-req-build-sS7cqz
ERROR: Exception:
Traceback (most recent call last):
  File "/home/moldach/.pyenv/versions/2.7.8/lib/python2.7/site-packages/pip/_internal/cli/base_comma$
    status = self.run(options, args)
  File "/home/moldach/.pyenv/versions/2.7.8/lib/python2.7/site-packages/pip/_internal/cli/req_comman$
    return func(self, options, args)
  File "/home/moldach/.pyenv/versions/2.7.8/lib/python2.7/site-packages/pip/_internal/commands/wheel$
    reqs, check_supported_wheels=True
  File "/home/moldach/.pyenv/versions/2.7.8/lib/python2.7/site-packages/pip/_internal/resolution/leg$
    discovered_reqs.extend(self._resolve_one(requirement_set, req))
  File "/home/moldach/.pyenv/versions/2.7.8/lib/python2.7/site-packages/pip/_internal/resolution/leg$
    abstract_dist = self._get_abstract_dist_for(req_to_install)
  File "/home/moldach/.pyenv/versions/2.7.8/lib/python2.7/site-packages/pip/_internal/resolution/leg$
    abstract_dist = self.preparer.prepare_linked_requirement(req)
  File "/home/moldach/.pyenv/versions/2.7.8/lib/python2.7/site-packages/pip/_internal/operations/pre$
    hashes=self._get_linked_req_hashes(req)
  File "/home/moldach/.pyenv/versions/2.7.8/lib/python2.7/site-packages/pip/_internal/operations/pre$
    unpack_file(file.path, location, file.content_type)
  File "/home/moldach/.pyenv/versions/2.7.8/lib/python2.7/site-packages/pip/_internal/utils/unpackin$
    tarfile.is_tarfile(filename) or
  File "/home/moldach/.pyenv/versions/2.7.8/lib/python2.7/tarfile.py", line 2589, in is_tarfile
    t = open(name)
  File "/home/moldach/.pyenv/versions/2.7.8/lib/python2.7/tarfile.py", line 1660, in open
    return func(name, "r", fileobj, **kwargs)
  File "/home/moldach/.pyenv/versions/2.7.8/lib/python2.7/tarfile.py", line 1722, in gzopen
    fileobj = bltn_open(name, mode + "b")
IOError: [Errno 2] No such file or directory: '/export/home/moldach/bin/wxPython-4.0.1.tar.gz'
Removed build tracker: '/tmp/pip-req-tracker-3FqrU4'

Although I had originally tried to make a conda Python 2 environment I thought I may be having conflicts with pyenv as even though it was activated it seems to be showing pyenv:

[moldach@galaxy bin]$ conda create --name py27 python=2.7
[moldach@galaxy bin]$ conda activate py27
(py27) [moldach@galaxy bin]$ which python
~/.pyenv/shims/python

At the bottom there is known issues with pyenv so I followed instructions for on the trouble-shooting/FAQ for pyenv which should have solved the issue but I'm getting an error:

(py27) [moldach@galaxy bin]$ env PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install 2.7.18
Downloading Python-2.7.18.tar.xz...
-> https://www.python.org/ftp/python/2.7.18/Python-2.7.18.tar.xz
Installing Python-2.7.18...
WARNING: The Python sqlite3 extension was not compiled. Missing the SQLite3 lib?
Installed Python-2.7.18 to /export/home/moldach/.pyenv/versions/2.7.18

(py27) [moldach@galaxy bin]$ conda deactivate
(base) [moldach@galaxy bin]$ conda deactivate
[moldach@galaxy bin]$ which python
~/.pyenv/shims/python
[moldach@galaxy bin]$ pyenv global 2.7.18
[moldach@galaxy bin]$ pip install -U wxPython

The log is WAY longer than the maximum of 65536 characters allowed here so I'm attaching a link to dropbox as well as the tail excerpt here:

Waf: Leaving directory `/tmp/pip-install-l9fXe1/wxPython/build/waf/2.7/gtk3'
    Build failed
     -> task in '_core' failed with exit status 1 (run with -v to display more information)
    Command '"/export/home/moldach/.pyenv/versions/2.7.18/bin/python2.7" /tmp/pip-install-l9fXe1/wxPython/bin/waf-2.0.19 --wx_config=/tmp/pip-install-l9fXe1/wxPython/build/wxbld/gtk3/wx-config --gtk3 --python="/export/home/moldach/.pyenv/versions/2.7.18/bin/python2.7" --out=build/waf/2.7/gtk3 configure build ' failed with exit code 1.
    Finished command: build_py (50.962s)
    Finished command: build (2m24.607s)
    Command '"/export/home/moldach/.pyenv/versions/2.7.18/bin/python2.7" -u build.py build' failed with exit code 1.
    ----------------------------------------
ERROR: Command errored out with exit status 1: /export/home/moldach/.pyenv/versions/2.7.18/bin/python2.7 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-l9fXe1/wxPython/setup.py'"'"'; __file__='"'"'/tmp/pip-install-l9fXe1/wxPython/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-02fghK/install-record.txt --single-version-externally-managed --compile Check the logs for full command output.
WARNING: You are using pip version 19.2.3, however version 20.2.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
swt2c commented 4 years ago

This is the relevant error from your log:

    ../../../../sip/cpp/sip_corewxUIActionSimulator.cpp: In function ‘PyObject* meth_wxUIActionSimulator_MouseMove(PyObject*, PyObject*, PyObject*)’:
    ../../../../sip/cpp/sip_corewxUIActionSimulator.cpp:31:10: error: ‘::wxUIActionSimulator’ has not been declared
              ::wxUIActionSimulator *sipCpp;
              ^
    ../../../../sip/cpp/sip_corewxUIActionSimulator.cpp:31:33: error: ‘sipCpp’ was not declared in this scope
              ::wxUIActionSimulator *sipCpp;
                                     ^
    ../../../../sip/cpp/sip_corewxUIActionSimulator.cpp:58:10: error: ‘::wxUIActionSimulator’ has not been declared

You didn't mention which Linux distribution you were using, but you need to install the package that contains xtest. After doing that, try the process again.

moldach commented 4 years ago

Distro:

$ less /etc/*-release
CentOS Linux release 7.3.1611 (Core)

$ lsb_release
LSB Version:    :core-4.1-amd64:core-4.1-noarch:cxx-4.1-amd64:cxx-4.1-noarch:desktop-4.1-amd64:desktop-4.1-noarch:languages-4.1-amd64:languages-4.1-noarch:printing-4.1-amd64:printing-4.1-noarch

This a shared academic HPC so I don't have root privileges. Do you know which package contains xtest. and how should I install (or ask support staff to do so)?

is it this? https://zoomadmin.com/HowToInstall/UbuntuPackage/libinput-pad-xtest

swt2c commented 4 years ago

For CentOS, the package name should be libXtst-devel so you would need to request support install that package.

However, since you're on a relatively common distribution, you can also install wxPython using pre-built wheels as well, see here for documentation: https://wxpython.org/pages/downloads/

For example, I think you could do:

pip install -U \
    -f https://extras.wxpython.org/wxPython4/extras/linux/gtk3/centos-7 \
    wxPython
moldach commented 4 years ago

The following worked:

conda create --name py27 python=2.7
conda activate py27
pip install -U \
    -f https://extras.wxpython.org/wxPython4/extras/linux/gtk3/centos-7 \
    wxPython

Thank you