如何安装模块?草莓Perl问题 [英] How do I install a module? Strawberry Perl issues

查看:193
本文介绍了如何安装模块?草莓Perl问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在Windows 7上的Strawberry Perl中安装Perl模块.

I am trying to install a Perl module within Strawberry Perl on Windows 7.

我正在运行以下命令,并且收到大量我不理解的消息.好像无法访问该页面,似乎收到500个错误.但是,当我在浏览器中指向镜像时,访问FTP目录没有问题.我在Linux上没有Perl的经验,而在Windows上则没有.我尝试手动向网址列表添加镜像,但我认为这样做没有帮助.

I'm running the below command and am getting a slew of messages I don't understand. It looks like I am getting 500 errors, as though the page isn't reachable. However, when I point the mirrors in my browser I have no problem accessing the FTP directories. I have little Perl experience on Linux, and none on Windows. I tried manually adding a mirror to the urllist, and I don't think that helped.

C:\Program Files> cpan Win32::IE::Mechanize

CPAN: LWP::UserAgent loaded ok (v5.835)
CPAN: Time::HiRes loaded ok (v1.9721)
Fetching with LWP:
http://cpan.strawberryperl.com/authors/01mailrc.txt.gz
LWP failed with code[500] message[Can't connect to cpan.strawberryperl.com:80 (Bad hostname 'cpan.strawberryperl.com')]
Warning: no success downloading 'C:\strawberry\cpan\sources\authors\01mailrc.txt.gz.tmp5264'. Giving up on it.
Fetching with LWP:
ftp://mirror.teklinks.com/CPAN/authors/01mailrc.txt.gz
LWP failed with code[500] message[LWP::Protocol::MyFTP: Bad hostname 'mirror.teklinks.com']
Fetching with Net::FTP:
ftp://mirror.teklinks.com/CPAN/authors/01mailrc.txt.gz
  Could not connect to host 'mirror.teklinks.com' with Net::FTP
Fetching with Net::FTP
ftp://mirror.teklinks.com/CPAN/authors/01mailrc.txt.gz.gz
  Could not connect to host 'mirror.teklinks.com' with Net::FTP
Warning: no success downloading 'C:\strawberry\cpan\sources\authors\01mailrc.txt.gz.tmp5264'. Giving up on it.
Warning: no success downloading 'C:\strawberry\cpan\sources\authors\01mailrc.txt.gz.tmp5264'. Giving up on it.

As a last resort we now switch to the external ftp command 'C:\WINDOWS\system32\ftp.EXE'
to get 'C:\strawberry\cpan\sources\authors\01mailrc.txt.gz.tmp5264'.

Doing so often leads to problems that are hard to diagnose.

If you're the victim of such problems, please consider unsetting the
ftp config variable with

    o conf ftp ""
    o conf commit

Issuing "C:\WINDOWS\system32\ftp.EXE -n"

  Trying with external ftp to get
    ftp://mirror.teklinks.com/CPAN/authors/01mailrc.txt.gz
  Going to send the dialog
    open mirror.teklinks.com
    user anonymous win32-vanilla@perl.org
    lcd C:\strawberry\cpan\sources\authors
    cd /
    cd CPAN
    cd authors
    bin
    passive
    get 01mailrc.txt.gz 01mailrc.txt.gz.tmp5264
    quit

Unknown host mirror.teklinks.com.
Not connected.
Local directory now C:\strawberry\cpan\sources\authors.
Not connected.
Not connected.
Not connected.
Not connected.
Invalid command.
Not connected.
Bad luck... Still failed!
Can't access URL ftp://mirror.teklinks.com/CPAN/authors/01mailrc.txt.gz.

Fetching with LWP:
http://cpan.strawberryperl.com/authors/01mailrc.txt.gz
LWP failed with code[500] message[Can't connect to cpan.strawberryperl.com:80 (Bad hostname 'cpan.strawberryperl.com')]
Warning: no success downloading 'C:\strawberry\cpan\sources\authors\01mailrc.txt.gz.tmp5264'. Giving up on it.
Warning: no success downloading 'C:\strawberry\cpan\sources\authors\01mailrc.txt.gz.tmp5264'. Giving up on it.
Fetching with LWP:
ftp://mirror.teklinks.com/CPAN/authors/01mailrc.txt.gz
LWP failed with code[500] message[LWP::Protocol::MyFTP: Bad hostname 'mirror.teklinks.com']
Fetching with Net::FTP:
ftp://mirror.teklinks.com/CPAN/authors/01mailrc.txt.gz
  Could not connect to host 'mirror.teklinks.com' with Net::FTP
Fetching with Net::FTP
ftp://mirror.teklinks.com/CPAN/authors/01mailrc.txt.gz.gz
  Could not connect to host 'mirror.teklinks.com' with Net::FTP
Warning: no success downloading 'C:\strawberry\cpan\sources\authors\01mailrc.txt.gz.tmp5264'. Giving up on it.
Warning: no success downloading 'C:\strawberry\cpan\sources\authors\01mailrc.txt.gz.tmp5264'. Giving up on it.

As a last resort we now switch to the external ftp command 'C:\WINDOWS\system32\ftp.EXE'
to get 'C:\strawberry\cpan\sources\authors\01mailrc.txt.gz.tmp5264'.

Doing so often leads to problems that are hard to diagnose.

If you're the victim of such problems, please consider unsetting the
ftp config variable with

    o conf ftp ""
    o conf commit

Issuing "C:\WINDOWS\system32\ftp.EXE -n"

  Trying with external ftp to get
    ftp://mirror.teklinks.com/CPAN/authors/01mailrc.txt.gz
  Going to send the dialog
    open mirror.teklinks.com
    user anonymous win32-vanilla@perl.org
    lcd C:\strawberry\cpan\sources\authors
    cd /
    cd CPAN
    cd authors
    bin
    passive
    get 01mailrc.txt.gz 01mailrc.txt.gz.tmp5264
    quit

Unknown host mirror.teklinks.com.
Not connected.
Local directory now C:\strawberry\cpan\sources\authors.
Not connected.
Not connected.
Not connected.
Not connected.
Invalid command.
Not connected.
Bad luck... Still failed!
Can't access URL ftp://mirror.teklinks.com/CPAN/authors/01mailrc.txt.gz.

CPAN: YAML loaded ok (v0.73)
Please check, if the URLs I found in your configuration file
(http://cpan.strawberryperl.com/, ftp://mirror.teklinks.com/CPAN/) are
valid. The urllist can be edited. E.g. with 'o conf urllist push
ftp://myurl/'

Could not fetch authors/01mailrc.txt.gz

推荐答案

这很容易是防火墙/代理问题.您需要在cpan中设置http_proxy变量.

This is easily firewall/proxy issues. You need to set up the http_proxy variable in cpan.

通过在shell命令提示符下键入cpan并单击 Enter 来输入CPAN shell.进入CPAN Shell后,输入以下内容:

Enter the CPAN shell by typing cpan at the shell command prompt, and hitting Enter. Once in the CPAN shell, enter the following:

o conf http_proxy http://proxy.mycorp.com:8080/

然后

cpan可能会要求您提供用户名和密码,以便至少可以将代理用于HTTP通信.

cpan may then ask you for the username and password so that you can use the proxy for HTTP traffic, at least.

防火墙可能阻止了您的FTP访问. cpan可以解决此问题.

It's possible that your FTP access is blocked by the firewall. cpan will work around this.

  • 如果代理配置很简单,则可以使用浏览器.
  • 如果更复杂,则必须
    • 将URL粘贴到浏览器地址中的配置脚本
    • 在浏览器提示您时,使用编辑器打开该URL(或使用带有HTTP URL的编辑器,例如 jEdit Notepad ++ .).
    • You can look to your browser if the proxy configuration is simple.
    • If it is more complex, you'll have to
      • paste the URL to the configuration script in the browser address
      • open that URL with an editor when the browser prompts you (or use an editor that takes HTTP URLs—like jEdit or Notepad++.).

      解析位置和CPAN的大小写后,您可以获取返回的服务器名称,添加端口(如果有),然后使用该值设置环境变量或cpan配置.

      Once you parse the case for your location and CPAN, then you can take the server name returned, add the port if any, and either set the environment variable or cpan configuration with the value.

      这篇关于如何安装模块?草莓Perl问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆