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

unidic 国内无法下载? #62

Open
bergli2020 opened this issue Mar 12, 2024 · 20 comments
Open

unidic 国内无法下载? #62

bergli2020 opened this issue Mar 12, 2024 · 20 comments

Comments

@bergli2020
Copy link

download url: https://cotonoha-dic.s3-ap-northeast-1.amazonaws.com/unidic-3.1.0.zip 国内无法访问,请教下如何解决?

RUN python3 -m unidic download:
2.445 Downloading UniDic v3.1.0+2021-08-31...
2.506 download url: https://cotonoha-dic.s3-ap-northeast-1.amazonaws.com/unidic-3.1.0.zip
2.506 Dictionary version: 3.1.0+2021-08-31
unidic-3.1.0.zip: 0.00B [00:00, ?B/s]
2.866 Traceback (most recent call last):
2.866 File "/usr/local/lib/python3.9/urllib/request.py", line 1346, in do_open
2.900 h.request(req.get_method(), req.selector, req.data, headers,
2.900 File "/usr/local/lib/python3.9/http/client.py", line 1285, in request
2.934 self._send_request(method, url, body, headers, encode_chunked)
2.934 File "/usr/local/lib/python3.9/http/client.py", line 1331, in _send_request
2.934 self.endheaders(body, encode_chunked=encode_chunked)
2.934 File "/usr/local/lib/python3.9/http/client.py", line 1280, in endheaders
2.934 self._send_output(message_body, encode_chunked=encode_chunked)
2.934 File "/usr/local/lib/python3.9/http/client.py", line 1040, in _send_output
2.935 self.send(msg)
2.935 File "/usr/local/lib/python3.9/http/client.py", line 980, in send
2.935 self.connect()
2.935 File "/usr/local/lib/python3.9/http/client.py", line 1454, in connect
2.936 self.sock = self._context.wrap_socket(self.sock,
2.936 File "/usr/local/lib/python3.9/ssl.py", line 500, in wrap_socket
2.936 return self.sslsocket_class._create(
2.936 File "/usr/local/lib/python3.9/ssl.py", line 1040, in _create
2.937 self.do_handshake()
2.937 File "/usr/local/lib/python3.9/ssl.py", line 1309, in do_handshake
2.937 self._sslobj.do_handshake()
2.937 ConnectionResetError: [Errno 104] Connection reset by peer

@liurongsheng
Copy link

确实需要梯子才行

@gotoolkits
Copy link

这个库是必须的还是可以忽略此下载?

@YingjiaoLiu
Copy link

用梯子下载好zip然后如何安装呢?远程服务器没法用命令python3 -m unidic download安装

@Game5048-bilibili
Copy link

我也想问qwq,大家都是怎么安装的

@Game5048-bilibili
Copy link

我解决了

@zhangguangxun
Copy link

我解决了

请教一下怎么解决的呢?

@Game5048-bilibili
Copy link

首先你需要pip install unidec
然后找你的python的路径,我这里是venv所以就拿venv说
我的路径是./python_venv/Lib/site-packages
接着你需要找unidecunidec_lite两个文件夹
我当时发现是unidec_lite中有个dicdir文件夹,而unidec中没有,而且报错中显示的目标也在这个文件夹中,所以我把dicdir复制了一份到unidec文件夹中,然后就可以了。

但是因为网络问题,这个程序还要下载亚马逊和huggingface里的配置文件和模型,我尝试过手动导入,但是我代码基础差看不懂,所以还是运行不了,你们如果解决了麻烦告诉我!!提前说声感谢

@Game5048-bilibili
Copy link

首先你需要pip install unidec 然后找你的python的路径,我这里是venv所以就拿venv说 我的路径是./python_venv/Lib/site-packages 接着你需要找unidecunidec_lite两个文件夹 我当时发现是unidec_lite中有个dicdir文件夹,而unidec中没有,而且报错中显示的目标也在这个文件夹中,所以我把dicdir复制了一份到unidec文件夹中,然后就可以了。

但是因为网络问题,这个程序还要下载亚马逊和huggingface里的配置文件和模型,我尝试过手动导入,但是我代码基础差看不懂,所以还是运行不了,你们如果解决了麻烦告诉我!!提前说声感谢

要是需要我提供文件夹请@我

@zhangguangxun
Copy link

首先你需要pip install unidec 然后找你的python的路径,我这里是venv所以就拿venv说 我的路径是./python_venv/Lib/site-packages 接着你需要找unidecunidec_lite两个文件夹 我当时发现是unidec_lite中有个dicdir文件夹,而unidec中没有,而且报错中显示的目标也在这个文件夹中,所以我把dicdir复制了一份到unidec文件夹中,然后就可以了。

但是因为网络问题,这个程序还要下载亚马逊和huggingface里的配置文件和模型,我尝试过手动导入,但是我代码基础差看不懂,所以还是运行不了,你们如果解决了麻烦告诉我!!提前说声感谢

感谢!我去试一下,感谢分享,有进展继续交流!

@Game5048-bilibili
Copy link

呃,我已经全部解决了!

@MissingTwins
Copy link

Try this in windows cmd

set HTTP_PROXY=http://127.0.0.1:7890
set HTTPS_PROXY=http://127.0.0.1:7890
python -m unidic download

Try this in bash

export HTTP_PROXY=http://127.0.0.1:7890
export HTTPS_PROXY=http://127.0.0.1:7890
python -m unidic download

@Game5048-bilibili
Copy link

Try this in windows cmd

set HTTP_PROXY=http://127.0.0.1:7890
set HTTPS_PROXY=http://127.0.0.1:7890
python -m unidic download

Try this in bash

export HTTP_PROXY=http://127.0.0.1:7890
export HTTPS_PROXY=http://127.0.0.1:7890
python -m unidic download

Yeah! It works!
Before inputing these, you need a proxy to connect AWS.

@hey135
Copy link

hey135 commented Apr 16, 2024

呃,我已经全部解决了!

怎么解决的呀

@morganwang010
Copy link

1, manaul download the unidic.zip from https://cotonoha-dic.s3-ap-northeast-1.amazonaws.com/unidic-3.1.0.zip,
2, cp unidic-3.1.0.zip to /usr/local/lib/python3.9/site-packages/unidic/ and rename it to unidic.zip
3, change /usr/local/lib/python3.9/site-packages/unidic/download.py line 93 , function download_version, comment all except download_and_clean(),
4, change the download_and_clean two parameter anything you want
5, change /usr/local/lib/python3.9/site-packages/unidic/download.py line 63, comment the download_process
then execut python -m unidic download again , it will be OK

@Super-Tree
Copy link

1, manaul download the unidic.zip from https://cotonoha-dic.s3-ap-northeast-1.amazonaws.com/unidic-3.1.0.zip, 2, cp unidic-3.1.0.zip to /usr/local/lib/python3.9/site-packages/unidic/ and rename it to unidic.zip 3, change /usr/local/lib/python3.9/site-packages/unidic/download.py line 93 , function download_version, comment all except download_and_clean(), 4, change the download_and_clean two parameter anything you want 5, change /usr/local/lib/python3.9/site-packages/unidic/download.py line 63, comment the download_process then execut python -m unidic download again , it will be OK

Yes,it works!

@zhangguangxun
Copy link

1, manaul download the unidic.zip from https://cotonoha-dic.s3-ap-northeast-1.amazonaws.com/unidic-3.1.0.zip, 2, cp unidic-3.1.0.zip to /usr/local/lib/python3.9/site-packages/unidic/ and rename it to unidic.zip 3, change /usr/local/lib/python3.9/site-packages/unidic/download.py line 93 , function download_version, comment all except download_and_clean(), 4, change the download_and_clean two parameter anything you want 5, change /usr/local/lib/python3.9/site-packages/unidic/download.py line 63, comment the download_process then execut python -m unidic download again , it will be OK

It works and help a lot

@zhangguangxun
Copy link

呃,我已经全部解决了!

怎么解决的呀

unidic的下载你可以参考morganwang010的方法,我试过是可行的
hugging face上的模型下载你可以考虑切换镜像源下载
参考配置代码pip install -U huggingface_hub export HF_ENDPOINT=https://hf-mirror.com
nltk的下载问题可以参考知乎文章:https://zhuanlan.zhihu.com/p/347931749
我通过上述方法调通了

@yiJianX
Copy link

yiJianX commented Apr 24, 2024 via email

@iskefu
Copy link

iskefu commented May 3, 2024

首先你需要pip install unidec 然后找你的python的路径,我这里是venv所以就拿venv说 我的路径是./python_venv/Lib/site-packages 接着你需要找unidecunidec_lite两个文件夹 我当时发现是unidec_lite中有个dicdir文件夹,而unidec中没有,而且报错中显示的目标也在这个文件夹中,所以我把dicdir复制了一份到unidec文件夹中,然后就可以了。
但是因为网络问题,这个程序还要下载亚马逊和huggingface里的配置文件和模型,我尝试过手动导入,但是我代码基础差看不懂,所以还是运行不了,你们如果解决了麻烦告诉我!!提前说声感谢

感谢!我去试一下,感谢分享,有进展继续交流!

这个可以解决python -m unidic download网络错误问题,
我开魔法也解决不了,这样确实解决了
剩下的就是开魔法一路通行,还要下个几百m

@easean2
Copy link

easean2 commented May 22, 2024

1, manaul download the unidic.zip from https://cotonoha-dic.s3-ap-northeast-1.amazonaws.com/unidic-3.1.0.zip, 2, cp unidic-3.1.0.zip to /usr/local/lib/python3.9/site-packages/unidic/ and rename it to unidic.zip 3, change /usr/local/lib/python3.9/site-packages/unidic/download.py line 93 , function download_version, comment all except download_and_clean(), 4, change the download_and_clean two parameter anything you want 5, change /usr/local/lib/python3.9/site-packages/unidic/download.py line 63, comment the download_process then execut python -m unidic download again , it will be OK

厉害!

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