Closed ta0chen closed 3 years ago
I've heard of this happening to one other person, I think they were on RHEL. I never found out what the problem ended up being in that case.
The reason it incorrectly recognizes you as Windows is because when it tries to import the curses module, the import fails. This is odd, because that module is standard: it comes packaged with Python in all systems that support ncurses (nearly everything but Windows), so it should work for you out of the box. The fact that it doesn't is very strange to me.
The way I see it, either the module doesn't exist at all, or it exists but fails to load for some other reason. If we can see the actual error the import gives, we may be able to better tell what might be going on. Run the python2
command and try:
import curses
import curses.panel
These are the two modules unicurses imports to check if the standard module is supported. The error messages may give us a clue as to what might be wrong.
I would also double check that you have the ncurses package installed. I don't use CentOS, but I'm looking at the package listing and there seem to be a few different rpms here: ncurses
, ncurses-libs
, ncurses-devel
, etc. You may or may not need one of those supplimentary packages for this to work.
Let me know, and thanks for reaching out!
Thanks for your kindly support. And here is the outputs of those commands.
[root@localhost Downloads]# python2 Python 2.7.14 (default, Dec 14 2017, 10:45:16) [GCC 4.4.7 20120313 (Red Hat 4.4.7-18)] on linux2 Type "help", "copyright", "credits" or "license" for more information.
import curses Traceback (most recent call last): File "
", line 1, in File "/usr/local/lib/python2.7/curses/init.py", line 15, in from _curses import ImportError: No module named _curses import curses.panel Traceback (most recent call last): File " ", line 1, in ImportError: No module named _cursesFile "/usr/local/lib/python2.7/curses/init.py", line 15, in from _curses import
So it looks like the module exists, but it's importing a module called _curses
that doesn't exist. Not certain why this is ... have you tried installing the ncurses-libs
and ncurses-devel
packages from yum
? It's a possibility that one of those might be required.
We have exactly the same problem. We are running:
rpm --query centos-release centos-release-6-8.el6.centos.12.3.x86_64
And we have installed: python --version Python 2.7.14
rpm -qa | grep curses ncurses-libs-5.7-4.20090207.el6.x86_64 ncurses-5.7-4.20090207.el6.x86_64 ncurses-base-5.7-4.20090207.el6.x86_64
When i do python2 Python 2.7.14 (default, Mar 6 2018, 15:44:06) [GCC 4.4.7 20120313 (Red Hat 4.4.7-17)] on linux2 Type "help", "copyright", "credits" or "license" for more information.
import curses Traceback (most recent call last): File "
", line 1, in File "/home/che/local/lib/python2.7/curses/init.py", line 15, in from _curses import * ImportError: No module named _curses
So we are going to try with additionally:
ncurses-devel.x86_64
installed.
Well i rolled back to Python 2.6.6 on Centos 6-8 Then argparse was missing. But a yum install python-argparse solved that problem. So now everything fine!
Maybe the "First, install the latest version of Python 2." is a little misleading. Actually in case of Centos 6 Python 2.6.6 seems to be fine...with the additional install.
The load error of curses is either incompatability of between Python 2.7 and Centos 6 or a linkage problem of the custom build, which i did for Python 2.7.
@chhex So to be clear, it seems like adding ncurses-devel
did not help for you. Is that correct?
@DarthFennec to be honest i did‘nt follow that path any more. I saw https://github.com/h2oai/h2o-2/wiki/installing-python-2.7-on-centos-6.3.-follow-this-sequence-exactly-for-centos-machine-only, and also this https://danieleriksson.net/2017/02/08/how-to-install-latest-python-on-centos/, which made me revert to 2.6.6
@DarthFennec specially https://danieleriksson.net/2017/02/08/how-to-install-latest-python-on-centos/ makes me think that i did‘nt buld python 7 correctly
Closing this issue due to age. Centos support has been deprecated due to changes by Redhat.
I got below error when running the script. My system is a CentOS 6.2 server. However the script seems wrongly recognised my system as a windows. And therefore, it is looking the PDCurses library.
[root@localhost nexus2artifactory-master]# ./NexusToArtifactory.py Fatal error: this platform is not supported by UniCurses (either you're running a very old Python distribution below v2.6, or you're using an exotic operating system that's neither Win nor *nix).
Traceback (most recent call last): File "./NexusToArtifactory.py", line 4, in
import unicurses
File "/root/Downloads/nexus2artifactory-master/unicurses.py", line 50, in
raise ImportError("UniCurses initialization error - unsupported platform.")
ImportError: UniCurses initialization error - unsupported platform.
[root@localhost nexus2artifactory-master]# python --version Python 2.7.14