python - 如何在 Python 中使用命令行运行可执行文件?
问题描述
我已经安装了这个包:https ://github.com/retostauffer/PyGFSV2 ,带有 pip。该软件包带有两个可执行文件(GFSV2_get 和 GFSV2_bulk)。但是,我不知道如何在 Python 中打开可执行文件。
因此,安装后,包作者建议通过调用尝试安装:
GFSV2_get --step 12 24 --level 700 850 --param tmp_pres --date 2005-01-01
所以,我输入了 Anaconda Prompt 下一个:
(base) C:\Users\vrida>CD C:\Users\vrida\anaconda3\Scripts
(base) C:\Users\vrida\anaconda3\Scripts>python GFSV2_get --step 12 24 --level 700 850 --param tmp_pres --date 2005-01-01
但是,它没有用。出现这个:
# DEBUG Loading default config file from package source.
# INFO Config file read, return.
# INFO Processing date 2005-01-01 00Z
# INFO Downloading inventory information data
# DEBUG Reading ftp://ftp.cdc.noaa.gov/Projects/Reforecast2/2005/200501/2005010100/mean/latlon\tmp_pres_2005010100_mean.grib2.inv
# ERROR Problems reading file, reason: "ftp error: URLError("ftp error: error_perm('550 Failed to change directory.')")".
# ERROR Could not download inventory file! Skip this.
# INFO Inventory empty, skip this file
# INFO Downloading inventory information data
# DEBUG Reading ftp://ftp.cdc.noaa.gov/Projects/Reforecast2/2005/200501/2005010100/sprd/latlon\tmp_pres_2005010100_sprd.grib2.inv
# ERROR Problems reading file, reason: "ftp error: URLError("ftp error: error_perm('550 Failed to change directory.')")".
# ERROR Could not download inventory file! Skip this.
# INFO Inventory empty, skip this file
我是 Python 的初学者。所以我有两个问题:
1 - 如何运行这些可执行文件,例如使用 Anaconda Prompt?
2 - 任何人都可以在尝试安装后下载软件包,如果成功,请告诉我如何制作相同的?
解决方案
我认为你应该联系包的维护者。显然,图书馆试图通过 ftp 下载一些文件,使用系统文件分隔符 \ 在你的情况下(因为你使用的是 Windows),而不是 /:ftp://ftp.cdc.noaa.gov/Projects/Reforecast2/2005 /200501/2005010100/mean/latlon \tmp_pres_2005010100_mean.grib2.inv
可以使用标准 ftp 客户端通过匿名 ftp 访问来访问该文件。所以这应该是python库的问题。
推荐阅读
- facebook - 无法使用 Facebook API 更新 Facebook 广告创意数据
- python - ESP32 - 将两个或多个 SDK 示例项目合二为一
- python - 使用 Bert - Python - Keras 进行多标签分类
- html - 如何在 VISUAL BASIC 中访问属性的超链接
- c++ - const char* 在 C++ CLI 中返回 true
- python - 如何从多个文本文件中获取元组列表(第 2 部分:Electric Boogaloo)?
- ruby-on-rails - 使用 Ruby on Rails 处理失败迁移的最佳策略
- python - Python/Flask - 从嵌套 JSON 打印响应值
- python - 相同型号中的烧瓶-sqlalchemy 一对一和多对一
- linux - KVM 在为 VM 分配内存时遵循什么策略?(例如,页面大小)