wong2 / pmm

PyPi Mirror Manager
MIT License
30 stars 0 forks source link

ImportError: No module named _curses in Windows #1

Open kghch opened 7 years ago

kghch commented 7 years ago

I have no idea whether this can be used in windows.

After pip install pmm and successfully installed it, when I run the pmm command, it returns the following:

Traceback (most recent call last): File "e:\python\lib\runpy.py", line 162, in _run_module_as_main "main", fname, loader, pkg_name) File "e:\python\lib\runpy.py", line 72, in _run_code exec code in run_globals File "E:\Python\Scripts\pmm.exe__main.py", line 5, in File "e:\python\lib\site-packages\pmm\cli.py", line 7, in from pick import pick File "e:\python\lib\site-packages\pick\init.py", line 3, in import curses File "e:\python\lib\curses\init__.py", line 15, in from _curses import * ImportError: No module named _curses

wong2 commented 7 years ago

@kghch windows doesn't natively support curses, but it seems you can install an extension from here: http://www.lfd.uci.edu/~gohlke/pythonlibs/#curses can you help me trying it out? I don't have a PC

kghch commented 7 years ago

@wong2 After installed curses-2.2-cp27-none-win_amd64.whl on Windows, I tried to run pmm in cmd and MINGW64 respectively.

In cmd, the pmm can start up in the GBK encoding enviroment, but with some unreadable code. And when I choose one mirror, it returns the error:

Traceback (most recent call last): File "e:\python\lib\runpy.py", line 162, in _run_module_as_main "main", fname, loader, pkg_name) File "e:\python\lib\runpy.py", line 72, in _run_code exec code in run_globals File "E:\Python\Scripts\pmm.exe__main__.py", line 9, in File "e:\python\lib\site-packages\pmm\cli.py", line 34, in main print(u'鉁? using mirror {} now'.format(crayons.cyan(choosed_index_url))) UnicodeEncodeError: 'gbk' codec can't encode character u'\u2728' in position 0: illegal multibyte sequence

I tried to switch to utf-8 encoding environment(in cmd, the command is chcp 65001). But it cannot even start up. With the following error:

Traceback (most recent call last): File "e:\python\lib\runpy.py", line 162, in _run_module_as_main "main", fname, loader, pkg_name) File "e:\python\lib\runpy.py", line 72, in _run_code exec code in run_globals File "E:\Python\Scripts\pmm.exe__main.py", line 5, in File "e:\python\lib\site-packages\pmm\cli.py", line 9, in from pmm import config File "e:\python\lib\site-packages\pmm\config.py", line 9, in from pip.locations import legacy_config_file File "e:\python\lib\site-packages\pip\init__.py", line 28, in from pip.vcs import git, mercurial, subversion, bazaar # noqa File "e:\python\lib\site-packages\pip\vcs\mercurial.py", line 9, in from pip.download import path_to_url File "e:\python\lib\site-packages\pip\download.py", line 37, in from pip.utils.ui import DownloadProgressBar, DownloadProgressSpinner File "e:\python\lib\site-packages\pip\utils\ui.py", line 57, in _BaseBar = _select_progress_class(IncrementalBar, Bar) File "e:\python\lib\site-packages\pip\utils\ui.py", line 50, in _select_progress_class six.text_type().join(characters).encode(encoding) LookupError: unknown encoding: cp65001

In MINGW64, it returns the following info:

$ pmm Redirection is not supported.

wong2 commented 7 years ago

@kghch thanks! I'll find a PC later and figure this out.