Hi,

I'm a Linux user, and have general knowledge of windows.

OK, have cygwin terminals working and have colorama and termcolor modules working. Colorrama allows use of termcolor on windows. So, when doing quick scripts that have some color in them programed on Linux I can quickly cxfreeze them on the windows machine and the mac for use by clients that use them without any computer awareness of Python.

All that is good, and yet Idle, pywin and ipython still don't recognize those modules. I ran rebaseall from an ash shell as suggested and it showed a lot being dealt with and the problem is still there.

Cygwin terminals do fine and the modules work in all scripts with the desired output.

Can anyone give me a little insight?

Thanks in advance,
jkrueger

Recommended Answers

All 8 Replies

I do not understand why you mentioned IDLE as it is not con sole application but you mean that you have problem running ipython from cygwin console?

Certain modules do not get recognized in python, idle, etc. Yet they do when they are run in python from cygwin terminal.
jkrueger

You mean that Colorama works when Python is started in cygwin and not when started from CMD, correct? It is supposed to only be needed when you are not in Unix-like (like cygwin) environments. What kind of error message are you getting?

I proved to install colorama in Python 2.7.1, first examples directly with colorama constant short hand did not work, but through termcolor it worked (maybe the first example is missing call to init):

from colorama import init
from termcolor import colored

# use Colorama to make Termcolor work on Windows too
init()

# then use Termcolor for all colored text output
print colored('Hello, World!', 'green', 'on_red')

No, sorry I must not be clear. I can run the scripts with the colorama module on window machine using Cygwin xrvt terminal. And when they are run from Idle or ipython on the windows machine I get an error message that the module is not found.

It seems to be a path problem with Idle and ipython etc., and I would like to be able to use them to make changes if necessary. Again, they do run fine in Cygwin terminal.

jkrueger

cygwin should not be needed in xrvt only in CMD. I think IPython should manage OK to run in Cygwin. Of course you do not want to replace windows CMD with cygwin? They are likely to have different commands with same name, so be careful not to crash your machine. Of course it is nice to have ls to work in addition to dir in CMD also. Still I do not see any connection between IDLE and cygwin environments.

cygwin should not be needed in xrvt only in CMD. I think IPython should manage OK to run in Cygwin. Of course you do not want to replace windows CMD with cygwin? They are likely to have different commands with same name, so be careful not to crash your machine. Of course it is nice to have ls to work in addition to dir in CMD also. Still I do not see any connection between IDLE and cygwin environments.

In Linux all terminals use commands that I'm very comfortable with, that is how I chose Cygwins terminals. With CMD I have to be in the python directory to run python, with xrvt I can be any where.

The issue really is running a script with colorama using xrvt $ python script.py, works and running from Idle or ipython I get error that module colorama is not found.

In Linux all terminals use commands that I'm very comfortable with, that is how I chose Cygwins terminals. With CMD I have to be in the python directory to run python, with xrvt I can be any where.

The issue really is running a script with colorama using xrvt $ python script.py, works and running from Idle or ipython I get error that module colorama is not found.

1/ Normally in windows, you don't need to be in the python directory to run python.
2/ I think you should have 2 installations of python: one in cygwin and the other one in windows, installed with a windows installer found here http://python.org/download/
3/ Therefore, you should have 2 installations of colorama, one for your cygwin python and one for the windows native python.

commented: agree +14

1/ Normally in windows, you don't need to be in the python directory to run python.
2/ I think you should have 2 installations of python: one in cygwin and the other one in windows, installed with a windows installer found here http://python.org/download/
3/ Therefore, you should have 2 installations of colorama, one for your cygwin python and one for the windows native python.

Thanks, I looked and it seems that I only have the one in Cygwin. Will do a windows intall as you suggested and see how it all works.

Again thanks,
jkrueger

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.