wxpython install error

Greetings, i installed wxpython with the comand:
pip install -U -f https://extras.wxpython.org/wxPython4/extras/linux/gtk3/fedora-28 \wxPython

Looking in links: https://extras.wxpython.org/wxPython4/extras/linux/gtk3/fedora-28

For my fedora computer, but after the install completed, i tried to run import wx and the next error prompted:

import wx

Traceback (most recent call last):

File “”, line 1, in

File “/home/rodrigo/anaconda2/lib/python2.7/site-packages/wx/init.py”, line 17, in

from wx.core import *

File “/home/rodrigo/anaconda2/lib/python2.7/site-packages/wx/core.py”, line 12, in

from ._core import *

ImportError: libpng12.so.0: cannot open shared object file: No such file or directory

What can i do about it, it says that i dont have that ._core archive even when i look for it, i tried to re-install the package but it didn’t work, what can i do, how can i fix this?

From beforehand thank you.

Hmm… The Fedora-28 build should be dynamic linking with libpng16.so, not libpng12. So something weird is definitely going on. Perhaps the wxPython being imported in your example is not actually the one you installed. Is the pip used from the same Python environment? Since you’re using anaconda, have you tried using conda to install wxPython? (Wxpython | Anaconda.org)

···

On Thursday, September 27, 2018 at 11:30:02 AM UTC-7, Croxmor Moraga wrote:

Greetings, i installed wxpython with the comand:
pip install -U -f https://extras.wxpython.org/wxPython4/extras/linux/gtk3/fedora-28 \wxPython

Looking in links: https://extras.wxpython.org/wxPython4/extras/linux/gtk3/fedora-28

For my fedora computer, but after the install completed, i tried to run import wx and the next error prompted:

import wx

Traceback (most recent call last):

File “”, line 1, in

File “/home/rodrigo/anaconda2/lib/python2.7/site-packages/wx/init.py”, line 17, in

from wx.core import *

File “/home/rodrigo/anaconda2/lib/python2.7/site-packages/wx/core.py”, line 12, in

from ._core import *

ImportError: libpng12.so.0: cannot open shared object file: No such file or directory

What can i do about it, it says that i dont have that ._core archive even when i look for it, i tried to re-install the package but it didn’t work, what can i do, how can i fix this?

From beforehand thank you.

Robin

Not actually, i used the one from my fedora
Because i use conda commands inside my astroconda envirioment

And my normal python is the 2.7

And the one from my astroconda is 3.0

Thats why i use pip

But i will check that archive you mentioned

···

El jue., 27 sept. 2018 4:52 PM, Robin Dunn robin@alldunn.com escribió:

On Thursday, September 27, 2018 at 11:30:02 AM UTC-7, Croxmor Moraga wrote:

Greetings, i installed wxpython with the comand:
pip install -U -f https://extras.wxpython.org/wxPython4/extras/linux/gtk3/fedora-28 \wxPython

Looking in links: https://extras.wxpython.org/wxPython4/extras/linux/gtk3/fedora-28

For my fedora computer, but after the install completed, i tried to run import wx and the next error prompted:

import wx

Traceback (most recent call last):

File “”, line 1, in

File “/home/rodrigo/anaconda2/lib/python2.7/site-packages/wx/init.py”, line 17, in

from wx.core import *

File “/home/rodrigo/anaconda2/lib/python2.7/site-packages/wx/core.py”, line 12, in

from ._core import *

ImportError: libpng12.so.0: cannot open shared object file: No such file or directory

What can i do about it, it says that i dont have that ._core archive even when i look for it, i tried to re-install the package but it didn’t work, what can i do, how can i fix this?

From beforehand thank you.

Hmm… The Fedora-28 build should be dynamic linking with libpng16.so, not libpng12. So something weird is definitely going on. Perhaps the wxPython being imported in your example is not actually the one you installed. Is the pip used from the same Python environment? Since you’re using anaconda, have you tried using conda to install wxPython? (https://anaconda.org/conda-forge/wxpython)

Robin

You received this message because you are subscribed to the Google Groups “wxPython-dev” group.

To unsubscribe from this group and stop receiving emails from it, send an email to wxPython-dev+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

And as i said before the error comes because i donar have the ._core archive, where can i find it?

···

El jue., 27 sept. 2018 5:15 PM, Croxmor Moraga rodrigo.moraga.merino@gmail.com escribió:

Not actually, i used the one from my fedora
Because i use conda commands inside my astroconda envirioment

And my normal python is the 2.7

And the one from my astroconda is 3.0

Thats why i use pip

But i will check that archive you mentioned

El jue., 27 sept. 2018 4:52 PM, Robin Dunn robin@alldunn.com escribió:

On Thursday, September 27, 2018 at 11:30:02 AM UTC-7, Croxmor Moraga wrote:

Greetings, i installed wxpython with the comand:
pip install -U -f https://extras.wxpython.org/wxPython4/extras/linux/gtk3/fedora-28 \wxPython

Looking in links: https://extras.wxpython.org/wxPython4/extras/linux/gtk3/fedora-28

For my fedora computer, but after the install completed, i tried to run import wx and the next error prompted:

import wx

Traceback (most recent call last):

File “”, line 1, in

File “/home/rodrigo/anaconda2/lib/python2.7/site-packages/wx/init.py”, line 17, in

from wx.core import *

File “/home/rodrigo/anaconda2/lib/python2.7/site-packages/wx/core.py”, line 12, in

from ._core import *

ImportError: libpng12.so.0: cannot open shared object file: No such file or directory

What can i do about it, it says that i dont have that ._core archive even when i look for it, i tried to re-install the package but it didn’t work, what can i do, how can i fix this?

From beforehand thank you.

Hmm… The Fedora-28 build should be dynamic linking with libpng16.so, not libpng12. So something weird is definitely going on. Perhaps the wxPython being imported in your example is not actually the one you installed. Is the pip used from the same Python environment? Since you’re using anaconda, have you tried using conda to install wxPython? (https://anaconda.org/conda-forge/wxpython)

Robin

You received this message because you are subscribed to the Google Groups “wxPython-dev” group.

To unsubscribe from this group and stop receiving emails from it, send an email to wxPython-dev+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Not actually, i used the one from my fedora
Because i use conda commands inside my astroconda envirioment

And my normal python is the 2.7

And the one from my astroconda is 3.0

Thats why i use pip

But, based on your error message it’s the anaconda Python that is importing wxPython, or if it is the system Python it is trying to import it from there instead of from the system’s or virtualenv’s site-packages folder. This is the path in your reported traceback that I’m basing this upon:

File “/home/rodrigo/anaconda2/lib/python2.7/site-packages/wx/init.py”,
And as i said before the error comes because i donar have the ._core archive, where can i find it?

Based on that traceback you should have a _core.so file in the /home/rodrigo/anaconda2/lib/python2.7/site-packages/wx folder. It is a binary extension module, not Python code. The ImportError indicates that either it, or something that it is dynamically loading is trying to load the libpng12.so.0 shared lib, but it isn’t found on your system.

You can use the ldd tool to list the shared library imports for the .so files. But first I would try to make sure that the pip you used actually targets the python environment you are using when importing wxPython. The easiest way to do this is to use “python -m pip” instead of just “pip”. Next make sure there isn’t something in that is messing with the sys.path (like setting PYTHONPATH in your environment) that might cause /home/rodrigo/anaconda2/lib/python2.7/site-packages/wx to be found before the …/site-packages/wx that pip will have installed to.

···

On Thursday, September 27, 2018 at 1:15:53 PM UTC-7, Croxmor Moraga wrote:

Robin

Thank you, i will take a look

···

El jue., 27 sept. 2018 9:15 PM, Robin Dunn robin@alldunn.com escribió:

On Thursday, September 27, 2018 at 1:15:53 PM UTC-7, Croxmor Moraga wrote:

Not actually, i used the one from my fedora
Because i use conda commands inside my astroconda envirioment

And my normal python is the 2.7

And the one from my astroconda is 3.0

Thats why i use pip

But, based on your error message it’s the anaconda Python that is importing wxPython, or if it is the system Python it is trying to import it from there instead of from the system’s or virtualenv’s site-packages folder. This is the path in your reported traceback that I’m basing this upon:

File “/home/rodrigo/anaconda2/lib/python2.7/site-packages/wx/init.py”,
And as i said before the error comes because i donar have the ._core archive, where can i find it?

Based on that traceback you should have a _core.so file in the /home/rodrigo/anaconda2/lib/python2.7/site-packages/wx folder. It is a binary extension module, not Python code. The ImportError indicates that either it, or something that it is dynamically loading is trying to load the libpng12.so.0 shared lib, but it isn’t found on your system.

You can use the ldd tool to list the shared library imports for the .so files. But first I would try to make sure that the pip you used actually targets the python environment you are using when importing wxPython. The easiest way to do this is to use “python -m pip” instead of just “pip”. Next make sure there isn’t something in that is messing with the sys.path (like setting PYTHONPATH in your environment) that might cause /home/rodrigo/anaconda2/lib/python2.7/site-packages/wx to be found before the …/site-packages/wx that pip will have installed to.

Robin

You received this message because you are subscribed to the Google Groups “wxPython-dev” group.

To unsubscribe from this group and stop receiving emails from it, send an email to wxPython-dev+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

i tried with python -m pip, but nothing changed :frowning:
i am going to try with conda.

But when i get inside my astroconda enviroment and use conda install wxpython, nothing changed when i import wx

···

El jue., 27 sept. 2018 a las 21:39, Croxmor Moraga (rodrigo.moraga.merino@gmail.com) escribió:

Thank you, i will take a look

El jue., 27 sept. 2018 9:15 PM, Robin Dunn robin@alldunn.com escribió:

On Thursday, September 27, 2018 at 1:15:53 PM UTC-7, Croxmor Moraga wrote:

Not actually, i used the one from my fedora
Because i use conda commands inside my astroconda envirioment

And my normal python is the 2.7

And the one from my astroconda is 3.0

Thats why i use pip

But, based on your error message it’s the anaconda Python that is importing wxPython, or if it is the system Python it is trying to import it from there instead of from the system’s or virtualenv’s site-packages folder. This is the path in your reported traceback that I’m basing this upon:

File “/home/rodrigo/anaconda2/lib/python2.7/site-packages/wx/init.py”,
And as i said before the error comes because i donar have the ._core archive, where can i find it?

Based on that traceback you should have a _core.so file in the /home/rodrigo/anaconda2/lib/python2.7/site-packages/wx folder. It is a binary extension module, not Python code. The ImportError indicates that either it, or something that it is dynamically loading is trying to load the libpng12.so.0 shared lib, but it isn’t found on your system.

You can use the ldd tool to list the shared library imports for the .so files. But first I would try to make sure that the pip you used actually targets the python environment you are using when importing wxPython. The easiest way to do this is to use “python -m pip” instead of just “pip”. Next make sure there isn’t something in that is messing with the sys.path (like setting PYTHONPATH in your environment) that might cause /home/rodrigo/anaconda2/lib/python2.7/site-packages/wx to be found before the …/site-packages/wx that pip will have installed to.

Robin

You received this message because you are subscribed to the Google Groups “wxPython-dev” group.

To unsubscribe from this group and stop receiving emails from it, send an email to wxPython-dev+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

You are right in what you said about libpng16, i have that one, but i dont know why wx search for a libpng12, because that doesn exist in my computer, how do i correct that, i tried what you said before.

···

El jueves, 27 de septiembre de 2018, 15:30:02 (UTC-3), Croxmor Moraga escribió:

Greetings, i installed wxpython with the comand:
pip install -U -f https://extras.wxpython.org/wxPython4/extras/linux/gtk3/fedora-28 \wxPython

Looking in links: https://extras.wxpython.org/wxPython4/extras/linux/gtk3/fedora-28

For my fedora computer, but after the install completed, i tried to run import wx and the next error prompted:

import wx

Traceback (most recent call last):

File “”, line 1, in

File “/home/rodrigo/anaconda2/lib/python2.7/site-packages/wx/init.py”, line 17, in

from wx.core import *

File “/home/rodrigo/anaconda2/lib/python2.7/site-packages/wx/core.py”, line 12, in

from ._core import *

ImportError: libpng12.so.0: cannot open shared object file: No such file or directory

What can i do about it, it says that i dont have that ._core archive even when i look for it, i tried to re-install the package but it didn’t work, what can i do, how can i fix this?

From beforehand thank you.

I still think that it is likely that some other install of wxPython is being incorrectly imported. If you have an older wxPython build, or perhaps one from anaconda, then it’s possible that they may be linking to the older libpng. Try running these commands to do a new trial in a new clean environment.

$ mkdir test # use whatever test folder location that you want

$ cd test

$ python2.7 -m virtualenv wxvenv # install virtualenv if you don’t already have it

$ source wxvenv/bin/activate

$ which python # verify it is the one in wxenv/bin

$ which pip # verify it is the one in wxenv/bin

$ echo $VIRTUAL_ENV

$ echo $PYTHONPATH

$ echo $PYTHONHOME

$ pip install -U -f Index of /wxPython4/extras/linux/gtk3/fedora-28 wxPython

$ python -c “import sys; print sys.prefix”

$ python -c “import sys, pprint; pprint.pprint(sys.path)”

$ python -c “import wx; print wx; print wx.version()”

If that still gives you the libpng12 error then copy the whole session (the commands and all their output) and paste it in a reply to this message.

···

On Friday, September 28, 2018 at 9:23:16 AM UTC-7, Croxmor Moraga wrote:

You are right in what you said about libpng16, i have that one, but i dont know why wx search for a libpng12, because that doesn exist in my computer, how do i correct that, i tried what you said before.

Robin

i tried it but it give me first this error:
New python executable in /home/rodrigo/Documentos/test/wxvenv/bin/python2.7

Also creating executable in /home/rodrigo/Documentos/test/wxvenv/bin/python

ERROR: The executable /home/rodrigo/Documentos/test/wxvenv/bin/python2.7 is not functioning

ERROR: It thinks sys.prefix is u’/usr’ (should be u’/home/rodrigo/Documentos/test/wxvenv’)

ERROR: virtualenv is not compatible with this system or executable

So i couldn’t make the new envirioment.

By the way when i tried the echo $VIRTUAL_ENV , PYTHONPATH AND PHYTONHOME

it didn’t return anything

[rodrigo@localhost ~]$ echo $PYTHONPATH

[rodrigo@localhost ~]$ echo $PYTHONHOME

What does that mean, because my echo $PATH always work when i used it and returns me the path, now what can i do?

···

El vie., 28 sept. 2018 a las 15:39, Robin Dunn (robin@alldunn.com) escribió:

On Friday, September 28, 2018 at 9:23:16 AM UTC-7, Croxmor Moraga wrote:

You are right in what you said about libpng16, i have that one, but i dont know why wx search for a libpng12, because that doesn exist in my computer, how do i correct that, i tried what you said before.

I still think that it is likely that some other install of wxPython is being incorrectly imported. If you have an older wxPython build, or perhaps one from anaconda, then it’s possible that they may be linking to the older libpng. Try running these commands to do a new trial in a new clean environment.

$ mkdir test # use whatever test folder location that you want

$ cd test

$ python2.7 -m virtualenv wxvenv # install virtualenv if you don’t already have it

$ source wxvenv/bin/activate

$ which python # verify it is the one in wxenv/bin

$ which pip # verify it is the one in wxenv/bin

$ echo $VIRTUAL_ENV

$ echo $PYTHONPATH

$ echo $PYTHONHOME

$ pip install -U -f https://extras.wxpython.org/wxPython4/extras/linux/gtk3/fedora-28 wxPython

$ python -c “import sys; print sys.prefix”

$ python -c “import sys, pprint; pprint.pprint(sys.path)”

$ python -c “import wx; print wx; print wx.version()”

If that still gives you the libpng12 error then copy the whole session (the commands and all their output) and paste it in a reply to this message.

Robin

You received this message because you are subscribed to the Google Groups “wxPython-dev” group.

To unsubscribe from this group and stop receiving emails from it, send an email to wxPython-dev+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

So it looks like you may need to backtrack a little more, and find out what python2.7 is being executed, as Fedora’s stock python 2.7 should have no problems being used in a virtualenv. (I’ve done it several times.) Run the following:

$ which python2.7

And if the printed result is not /usr/bin/python2.7 then try using the full /usr/bin/python2.7 path when running python to make the virtualenv. If it does print /usr/bin/python2.7 then you will need to figure out what has happened to the default python installation on the system.

···

On Saturday, September 29, 2018 at 3:12:17 PM UTC-7, Croxmor Moraga wrote:

i tried it but it give me first this error:
New python executable in /home/rodrigo/Documentos/test/wxvenv/bin/python2.7

Also creating executable in /home/rodrigo/Documentos/test/wxvenv/bin/python

ERROR: The executable /home/rodrigo/Documentos/test/wxvenv/bin/python2.7 is not functioning

ERROR: It thinks sys.prefix is u’/usr’ (should be u’/home/rodrigo/Documentos/test/wxvenv’)

ERROR: virtualenv is not compatible with this system or executable

So i couldn’t make the new envirioment.

Robin

By the way when i tried the echo $VIRTUAL_ENV , PYTHONPATH AND PHYTONHOME

it didn’t return anything

[rodrigo@localhost ~]$ echo $PYTHONPATH

[rodrigo@localhost ~]$ echo $PYTHONHOME

What does that mean, because my echo $PATH always work when i used it and returns me the path, now what can i do?

El vie., 28 sept. 2018 a las 15:39, Robin Dunn (robin@alldunn.com) escribió:

On Friday, September 28, 2018 at 9:23:16 AM UTC-7, Croxmor Moraga wrote:

You are right in what you said about libpng16, i have that one, but i dont know why wx search for a libpng12, because that doesn exist in my computer, how do i correct that, i tried what you said before.

I still think that it is likely that some other install of wxPython is being incorrectly imported. If you have an older wxPython build, or perhaps one from anaconda, then it’s possible that they may be linking to the older libpng. Try running these commands to do a new trial in a new clean environment.

$ mkdir test # use whatever test folder location that you want

$ cd test

$ python2.7 -m virtualenv wxvenv # install virtualenv if you don’t already have it

$ source wxvenv/bin/activate

$ which python # verify it is the one in wxenv/bin

$ which pip # verify it is the one in wxenv/bin

$ echo $VIRTUAL_ENV

$ echo $PYTHONPATH

$ echo $PYTHONHOME

$ pip install -U -f https://extras.wxpython.org/wxPython4/extras/linux/gtk3/fedora-28 wxPython

$ python -c “import sys; print sys.prefix”

$ python -c “import sys, pprint; pprint.pprint(sys.path)”

$ python -c “import wx; print wx; print wx.version()”

If that still gives you the libpng12 error then copy the whole session (the commands and all their output) and paste it in a reply to this message.

Robin

You received this message because you are subscribed to the Google Groups “wxPython-dev” group.

To unsubscribe from this group and stop receiving emails from it, send an email to wxPython-dev+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

I just wanted to make sure that they are not set to anything as they could affect how and where Python looks for packages to import. So, no worries.

···

On Saturday, September 29, 2018 at 3:12:17 PM UTC-7, Croxmor Moraga wrote:

By the way when i tried the echo $VIRTUAL_ENV , PYTHONPATH AND PHYTONHOME

it didn’t return anything

[rodrigo@localhost ~]$ echo $PYTHONPATH

[rodrigo@localhost ~]$ echo $PYTHONHOME

What does that mean, because my echo $PATH always work when i used it and returns me the path, now what can i do?

Robin

definitely when i use the usr/bin/python2.7 it uses that python, but when i tried to used pip to install packages on that one, to make the virtualenv, it throws this:
Exception:

Traceback (most recent call last):

File “/usr/lib/python2.7/site-packages/pip/basecommand.py”, line 215, in main

status = self.run(options, args)

File “/usr/lib/python2.7/site-packages/pip/commands/install.py”, line 365, in run

strip_file_prefix=options.strip_file_prefix,

File “/usr/lib/python2.7/site-packages/pip/req/req_set.py”, line 784, in install

**kwargs

File “/usr/lib/python2.7/site-packages/pip/req/req_install.py”, line 854, in install

strip_file_prefix=strip_file_prefix

File “/usr/lib/python2.7/site-packages/pip/req/req_install.py”, line 1069, in move_wheel_files

strip_file_prefix=strip_file_prefix,

File “/usr/lib/python2.7/site-packages/pip/wheel.py”, line 345, in move_wheel_files

clobber(source, lib_dir, True)

File “/usr/lib/python2.7/site-packages/pip/wheel.py”, line 316, in clobber

ensure_dir(destdir)

File “/usr/lib/python2.7/site-packages/pip/utils/init.py”, line 83, in ensure_dir

os.makedirs(path)

File “/usr/lib64/python2.7/os.py”, line 157, in makedirs

mkdir(name, mode)

OSError: [Errno 13] Permission denied: ‘/usr/lib/python2.7/site-packages/python_dateutil-2.7.3.dist-info’

I dont know why it throwsthis, does pip works from an speciffic python orsomething like that?

···

El lun., 1 oct. 2018 a las 15:35, Robin Dunn (robin@alldunn.com) escribió:

On Saturday, September 29, 2018 at 3:12:17 PM UTC-7, Croxmor Moraga wrote:

By the way when i tried the echo $VIRTUAL_ENV , PYTHONPATH AND PHYTONHOME

it didn’t return anything

[rodrigo@localhost ~]$ echo $PYTHONPATH

[rodrigo@localhost ~]$ echo $PYTHONHOME

What does that mean, because my echo $PATH always work when i used it and returns me the path, now what can i do?

I just wanted to make sure that they are not set to anything as they could affect how and where Python looks for packages to import. So, no worries.

Robin

You received this message because you are subscribed to the Google Groups “wxPython-dev” group.

To unsubscribe from this group and stop receiving emails from it, send an email to wxPython-dev+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

You need root access to install into the system Python, but IMO you should not want to do that except in some special circumstances. Instead, you can install Fedora’s virtualenv package with the dnf tool, (python2-virtualenv if I remember correctly) and then use that to make new Python environments in folders that you do have write access to.

···

On Monday, October 1, 2018 at 6:42:59 PM UTC-7, Croxmor Moraga wrote:

definitely when i use the usr/bin/python2.7 it uses that python, but when i tried to used pip to install packages on that one, to make the virtualenv, it throws this:
Exception:

Traceback (most recent call last):

File “/usr/lib/python2.7/site-packages/pip/basecommand.py”, line 215, in main

status = self.run(options, args)

File “/usr/lib/python2.7/site-packages/pip/commands/install.py”, line 365, in run

strip_file_prefix=options.strip_file_prefix,

File “/usr/lib/python2.7/site-packages/pip/req/req_set.py”, line 784, in install

**kwargs

File “/usr/lib/python2.7/site-packages/pip/req/req_install.py”, line 854, in install

strip_file_prefix=strip_file_prefix

File “/usr/lib/python2.7/site-packages/pip/req/req_install.py”, line 1069, in move_wheel_files

strip_file_prefix=strip_file_prefix,

File “/usr/lib/python2.7/site-packages/pip/wheel.py”, line 345, in move_wheel_files

clobber(source, lib_dir, True)

File “/usr/lib/python2.7/site-packages/pip/wheel.py”, line 316, in clobber

ensure_dir(destdir)

File “/usr/lib/python2.7/site-packages/pip/utils/init.py”, line 83, in ensure_dir

os.makedirs(path)

File “/usr/lib64/python2.7/os.py”, line 157, in makedirs

mkdir(name, mode)

OSError: [Errno 13] Permission denied: ‘/usr/lib/python2.7/site-packages/python_dateutil-2.7.3.dist-info’

I dont know why it throwsthis, does pip works from an speciffic python orsomething like that?

Robin