
我遇到了 Anaconda 的 r-essentials 套件中的 r-repr 套件的問題,該問題使我無法在 jupyter 筆記本中執行時間序列程式碼,如套件的 github 上所述:https://github.com/IRkernel/repr/issues/117
令人高興的是,上面的連結還看到這個問題已透過套件的 Github 儲存庫上的提交 505a052 修復。
遺憾的是,我沒有成功實現此更新 - conda 不向 r-repr 包提供此更新,當我嘗試從 conda 下載提交時,如下所述:https://stackoverflow.com/questions/19042389/conda-installing-upgrading-directly-from-github ,我無法讓它工作,收到此錯誤:
ERROR: Command errored out with exit status 1:
command: 'C:\Users\Owner\Anaconda3\envs\tester\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Owner\\AppData\\Local\\Temp\\pip-req-build-8fj3m_ve\\setup.py'"'"'; __file__='"'"'C:\\Users\\Owner\\AppData\\Local\\Temp\\pip-req-build-8fj3m_ve\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base pip-egg-info
cwd: C:\Users\Owner\AppData\Local\Temp\pip-req-build-8fj3m_ve\
Complete output (5 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\Owner\Anaconda3\envs\tester\lib\tokenize.py", line 447, in open
buffer = _builtin_open(filename, 'rb')
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\Owner\\AppData\\Local\\Temp\\pip-req-build-8fj3m_ve\\setup.py'
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
我甚至嘗試按照在運行 R 核心的 Jupyter 筆記本中的 R 或 R studio (install.packages('repr')) 中的方式更新軟體包,但它破壞了整個 Anaconda 安裝。
有誰知道發起相關提交或以其他方式在 conda 中更新此套件的最佳方法?
答案1
如果有人在 jupyter 筆記本中運行 repr 包時遇到此問題,我發現解決方法不是通過 github 更新包,也不是安裝正常的 cran 方式 (install.packages('repr')) jupyter 筆記本(正如我所提到的,這樣做破壞了我的安裝)。
相反,我發現在 anaconda 中安裝 RStudio、啟動它並使用 install.packages('repr') 可以讓我成功更新套件。然後我就可以毫無問題地使用相同的 jupyter 筆記本。