Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

更新到0.5.4.1版本失败 #5

Closed
Sean16SYSU opened this issue Jun 13, 2019 · 7 comments
Closed

更新到0.5.4.1版本失败 #5

Sean16SYSU opened this issue Jun 13, 2019 · 7 comments

Comments

@Sean16SYSU
Copy link
Contributor

当输入了,
pip install harvesttext==0.5.4.1 --extra-index-url https://pypi.python.org/simple
时,
安装出现了问题:

Exception:
Traceback (most recent call last):
  File "c:\users\lijy2\appdata\local\programs\python\python36\lib\site-packages\pip\_internal\cli\base_command.py", line 179, in main
    status = self.run(options, args)
  File "c:\users\lijy2\appdata\local\programs\python\python36\lib\site-packages\pip\_internal\commands\install.py", line 393, in run
    use_user_site=options.use_user_site,
  File "c:\users\lijy2\appdata\local\programs\python\python36\lib\site-packages\pip\_internal\req\__init__.py", line 50, in install_given_reqs
    auto_confirm=True
  File "c:\users\lijy2\appdata\local\programs\python\python36\lib\site-packages\pip\_internal\req\req_install.py", line 816, in uninstall
    uninstalled_pathset = UninstallPathSet.from_dist(dist)
  File "c:\users\lijy2\appdata\local\programs\python\python36\lib\site-packages\pip\_internal\req\req_uninstall.py", line 496, in from_dist
    for path in uninstallation_paths(dist):
  File "c:\users\lijy2\appdata\local\programs\python\python36\lib\site-packages\pip\_internal\req\req_uninstall.py", line 50, in unique
    for item in fn(*args, **kw):
  File "c:\users\lijy2\appdata\local\programs\python\python36\lib\site-packages\pip\_internal\req\req_uninstall.py", line 67, in uninstallation_paths
    r = csv.reader(FakeFile(dist.get_metadata_lines('RECORD')))
  File "c:\users\lijy2\appdata\local\programs\python\python36\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 1414, in get_metadata_lines
    return yield_lines(self.get_metadata(name))
  File "c:\users\lijy2\appdata\local\programs\python\python36\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 1411, in get_metadata
    return value.decode('utf-8') if six.PY3 else value
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb0 in position 1921: invalid start byte

加上-U命令也是不行

@blmoistawinde
Copy link
Owner

我也遇到了类似问题,不过这个不是我的库的原因,是pip的问题(可能跟extra-index-url有关,是因为刚刚更新,我用的pip镜像站还找不到所以才加了这个备用源)。而且神奇的是,即使报了错,我发现新版已经装上了。你看看你有没有装上吧,如果好了就无视之吧

@Sean16SYSU
Copy link
Contributor Author

测试了下,好像失败了。说没有scale

@blmoistawinde
Copy link
Owner

错误应该发生在卸载的时候,因为注意到错误里有(uninstall):

File "c:\users\lijy2\appdata\local\programs\python\python36\lib\site-packages\pip\_internal\req\req_uninstall.py", line 496, in from_dist
    for path in uninstallation_paths(dist):

如果你尝试pip uninstall harvesttext,应该也会发现一样的问题。
这可能是因为pip在卸载带有Unicode资源(我的那些中文词库)的时候会出现这个问题。我后面再想想怎么解决这个问题。

如果你要现在就用上新版的话,可以找到你的python安装环境里的site-packages里,找到这个库相关的文件夹,把库手动删掉,再安装试试。

@Sean16SYSU
Copy link
Contributor Author

手动删掉也不太行,能直接源码安装嘛?

@Sean16SYSU
Copy link
Contributor Author

手动删掉之后,我再安装也遇到同样的结果。

Exception:
Traceback (most recent call last):
  File "c:\users\lijy2\appdata\local\programs\python\python36\lib\site-packages\pip\_internal\cli\base_command.py", line 179, in main
    status = self.run(options, args)
  File "c:\users\lijy2\appdata\local\programs\python\python36\lib\site-packages\pip\_internal\commands\install.py", line 393, in run
    use_user_site=options.use_user_site,
  File "c:\users\lijy2\appdata\local\programs\python\python36\lib\site-packages\pip\_internal\req\__init__.py", line 57, in install_given_reqs
    **kwargs
  File "c:\users\lijy2\appdata\local\programs\python\python36\lib\site-packages\pip\_internal\req\req_install.py", line 913, in install
    use_user_site=use_user_site, pycompile=pycompile,
  File "c:\users\lijy2\appdata\local\programs\python\python36\lib\site-packages\pip\_internal\req\req_install.py", line 445, in move_wheel_files
    warn_script_location=warn_script_location,
  File "c:\users\lijy2\appdata\local\programs\python\python36\lib\site-packages\pip\_internal\wheel.py", line 607, in move_wheel_files
    generated=generated, lib_dir=lib_dir,
  File "c:\users\lijy2\appdata\local\programs\python\python36\lib\site-packages\pip\_internal\wheel.py", line 275, in get_csv_rows_for_installed
    for row in old_csv_rows:
UnicodeDecodeError: 'gbk' codec can't decode byte 0xa8 in position 1113: illegal multibyte sequence

源码安装,可以嘛?求一波~hhh

@Sean16SYSU
Copy link
Contributor Author

git clone https://github.com/blmoistawinde/HarvestText.git
cd HarvestText/
python setup.py build
python setup.py install

完成配置

@blmoistawinde
Copy link
Owner

已经发现这个问题的根源了,我的resources里面的文件使用了中文"百度停用词表.json",现在把它改成英文名以后,安装和卸载的问题应该都不会有了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants