Python Forum
Trying to setup Python application, odd error
Thread Rating:
  • 2 Vote(s) - 2.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Trying to setup Python application, odd error
#1
Although python3 cannot find the Cython module:

[inline] python3 setup.py
Could not import cx_Freeze. Building executable not possible.
Traceback (most recent call last):
File "setup.py", line 13, in <module>
from Cython.Build import cythonize
ImportError: No module named 'Cython'[/inline]

pip3 says it has been installed:
[inline]
pip3 install Cython
Requirement already satisfied (use --upgrade to upgrade): Cython in /usr/local/lib/python3.4/dist-packages
Cleaning up...[/inline]

What is going on? How do I fix this?

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Some more relevant information:
Pip version:

[inline] pip3 -V
pip 1.5.4 from /usr/lib/python3/dist-packages (python 3.4)[/inline]

Python version:

[inline] python3 -V
Python 3.4.6[/inline]

Tried to install from within Python session:

[inline] python3
Python 3.4.6 (default, May 11 2017, 18:25:35)
[GCC 4.8.4] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> import Cython
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named 'Cython'
>>> sys.executable
'/usr/local/bin/python3'
>>> exit()

python3 -m pip install module
/usr/local/bin/python3: No module named pip

python3 -m pip Cython
/usr/local/bin/python3: No module named pip

sudo apt-get install python3-pip
Reading package lists... Done
Building dependency tree
Reading state information... Done
python3-pip is already the newest version.
The following packages were automatically installed and are no longer required:
libgsoap4 libvncserver0
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 189 not upgraded.[/inline]

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

I tried cutting and pasting the stuff in /usr/local/lib/python3.4/dist-packages to /usr/local/lib/python3.4, but I end up with weird errors, like this:

[inline] Traceback (most recent call last):
File "setup.py", line 13, in <module>
from Cython.Build import cythonize
File "/usr/local/lib/python3.4/Cython/Build/__init__.py", line 1, in <module>
from .Dependencies import cythonize
File "/usr/local/lib/python3.4/Cython/Build/Dependencies.py", line 51, in <module>
from ..Compiler.Main import Context, CompilationOptions, default_options
File "/usr/local/lib/python3.4/Cython/Compiler/Main.py", line 30, in <module>
from .Symtab import ModuleScope
File "/usr/local/lib/python3.4/Cython/Compiler/Symtab.py", line 18, in <module>
from . import PyrexTypes
File "/usr/local/lib/python3.4/Cython/Compiler/PyrexTypes.py", line 17, in <module>
from .Code import UtilityCode, LazyUtilityCode, TempitaUtilityCode
ImportError: /usr/local/lib/python3.4/Cython/Compiler/Code.cpython-34m.so: undefined symbol: PyFPE_jbuf[/inline]

I am on Linux Mint Cinnamon 64-bit.
Reply
#2
you list off responses from directories...
  • /usr/local/lib/python3.4 
  • /usr/local/bin/python3 
  • /usr/lib/python3 
/usr/lib/python3 and /usr/local/lib/python3.4 are not the same. local is for locally installed programs or programs you did not install with a package manager (ie. apt-get. So you must have numerous python installations, may or may not be the same version, but one with pip/cython and one without. One in /usr/bin and at least another one in /usr/local/bin
 
Quote:I tried cutting and pasting the stuff in /usr/local/lib/python3.4/dist-packages to /usr/local/lib/python3.4,
I would not do anything like this. First of all dist-packages are where 3rd party libs go for python. Secondly, if you cut and paste other stuff like i would restart with a fresh new install of python3.X and start back at square one. Do not remove python2.x as it can mess your system up.

Also it appears you might of symlinked your python3 to your local directory or an alias?
Reply
#3
(Jul-31-2017, 01:00 AM)metulburr Wrote: you list off responses from directories...
  • /usr/local/lib/python3.4 
  • /usr/local/bin/python3 
  • /usr/lib/python3 
/usr/lib/python3 and /usr/local/lib/python3.4 are not the same. local is for locally installed programs or programs you did not install with a package manager (ie. apt-get. So you must have numerous python installations, may or may not be the same version, but one with pip/cython and one without. One in /usr/bin and at least another one in /usr/local/bin
 
Quote:I tried cutting and pasting the stuff in /usr/local/lib/python3.4/dist-packages to /usr/local/lib/python3.4,
I would not do anything like this. First of all dist-packages are where 3rd party libs go for python. Secondly, if you cut and paste other stuff like i would restart with a fresh new install of python3.X and start back at square one. Do not remove python2.x as it can mess your system up.

Also it appears you might of symlinked your python3 to your local directory or an alias?

How do I reinstall Python 3? sudo apt-get remove --purge does not work.
Reply
#4
Hello? Is there anyone who knows how to reinstall Python 3?
Reply
#5
See @snippsat's answer on this post https://python-forum.io/Thread-Interpete...aller-help
If it ain't broke, I just haven't gotten to it yet.
OS: Windows 10, openSuse 42.3, freeBSD 11, Raspian "Stretch"
Python 3.6.5, IDE: PyCharm 2018 Community Edition
Reply
#6
I want to reinstall it, not install an alternative.
Reply
#7
You should try to uninstall and delete anything related to python, then do a new reinstall. It is quite annoying and frustrating, however with the right guide, you can fix the problem you are having. You can try reading this article by SIITGo.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to send data from a python application to an external application aditya_rajiv 1 586 Jul-26-2021, 06:00 AM
Last Post: ndc85430
  python application and credentials safety concern aster 4 1,444 Mar-06-2021, 06:51 PM
Last Post: snippsat
  VSCode Setup and configuring to run with Python apollo 2 1,440 Jan-13-2021, 04:55 PM
Last Post: jefsummers
  Python Idlex setup robsuttonjr 3 1,049 Jan-09-2021, 09:54 PM
Last Post: Gribouillis
  ModuleNotFoundError when application is not installed via setup.py bytebutcher 3 948 Jan-08-2021, 10:28 AM
Last Post: Gribouillis
  python setup.py install error blackclover 2 3,109 Jan-07-2021, 04:36 AM
Last Post: blackclover
  Keep Application running after Python script ends PEGylated_User 0 806 Nov-12-2020, 03:27 PM
Last Post: PEGylated_User
  'python setup.py bdist' gets error on 'compiler_flags' 1780yz 0 966 Sep-02-2020, 09:17 PM
Last Post: 1780yz
  Installing Python Application pplgf 3 1,305 Apr-27-2020, 10:51 PM
Last Post: Larz60+
  Python to setup samuelbachorik 2 1,163 Apr-19-2020, 11:19 AM
Last Post: samuelbachorik

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020