MetaTrader 5 Python用户组 - 如何在Metatrader中使用Python - 页 28

 
好吧,如果所有的数据都来自一个终端,那么很明显,时间转移并不重要。但这应该是一个分析工具(如链接到新闻或其他数据)--而那里的时间是不同的,所以你必须转换。
 
Lyuk:
好吧,如果所有的数据都来自一个终端,那么很明显,时间转移并不重要。但这应该是一个用于分析的工具(例如,链接到新闻或其他数据)--而那里的时间是不同的,所以我们必须转换它。

看上去很容易

pd.tz_convert(None)
https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Series.dt.tz_convert.html
 
这并不难,当你已经发现了一个需要时间来纠正的错误时,调试就很困难。
 

该库没有安装,甚至没有更新。我目前使用的版本是5.0.4,最新版本是5.0.8。

这是个日志。我应该怎么做?

Collecting MetaTrader5
  Downloading https: //files.pythonhosted.org/packages/56/76/58682d9a70b8eea2a707634125fb495bf457b21fef565d2d4bac559aad94/MetaTrader5-5.0.8.tar.gz
Building wheels for collected packages: MetaTrader5
  Building wheel for MetaTrader5 (setup.py) ... error
  ERROR: Command errored out with exit status 1 :
   command: 'c:\python35\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = ' "'" 'C:\\Users\\la\\AppData\\Local\\Temp\\pip-install-s2bqudzg\\MetaTrader5\\setup.py' "'" '; __file__=' "'" 'C:\\Users\\la\\AppData\\Local\\Temp\\pip-install-s2bqudzg\\MetaTrader5\\setup.py' "'" ';f=getattr(tokenize, ' "'" 'open' "'" ', open)(__file__);code=f.read().replace(' "'" '\r\n' "'" ', ' "'" '\n' "'" ');f.close();exec(compile(code, __file__, ' "'" 'exec' "'" '))'  bdist_wheel -d  'C:\Users\la\AppData\Local\Temp\pip-wheel-6x877lgv'  --python-tag cp35
        cwd: C:\Users\la\AppData\Local\Temp\pip-install-s2bqudzg\MetaTrader5\
  Complete output ( 10 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build\lib.win-amd64- 3.5
  creating build\lib.win-amd64- 3.5 \MetaTrader5
  copying MetaTrader5\__init__.py -> build\lib.win-amd64- 3.5 \MetaTrader5
  running build_ext
  building 'MetaTrader5.C' extension
  error: [WinError 2 ] The system cannot find the file specified
  ----------------------------------------
  ERROR: Failed building wheel for MetaTrader5
  Running setup.py clean for MetaTrader5
Failed to build MetaTrader5
Installing collected packages: MetaTrader5
  Found existing installation: MetaTrader5 5.0 . 4
    Uninstalling MetaTrader5- 5.0 . 4 :
      Successfully uninstalled MetaTrader5- 5.0 . 4
    Running setup.py install for MetaTrader5 ... error
    ERROR: Command errored out with exit status 1 :
     command: 'c:\python35\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = ' "'" 'C:\\Users\\la\\AppData\\Local\\Temp\\pip-install-s2bqudzg\\MetaTrader5\\setup.py' "'" '; __file__=' "'" 'C:\\Users\\la\\AppData\\Local\\Temp\\pip-install-s2bqudzg\\MetaTrader5\\setup.py' "'" ';f=getattr(tokenize, ' "'" 'open' "'" ', open)(__file__);code=f.read().replace(' "'" '\r\n' "'" ', ' "'" '\n' "'" ');f.close();exec(compile(code, __file__, ' "'" 'exec' "'" '))' install --record 'C:\Users\la\AppData\Local\Temp\pip-record-7ohhmuga\install-record.txt'  --single-version-externally-managed --compile
          cwd: C:\Users\la\AppData\Local\Temp\pip-install-s2bqudzg\MetaTrader5\
    Complete output ( 10 lines):
    running install
    running build
    running build_py
    creating build
    creating build\lib.win-amd64- 3.5
    creating build\lib.win-amd64- 3.5 \MetaTrader5
    copying MetaTrader5\__init__.py -> build\lib.win-amd64- 3.5 \MetaTrader5
    running build_ext
    building 'MetaTrader5.C' extension
    error: [WinError 2 ] The system cannot find the file specified
    ----------------------------------------
  Rolling back uninstall of MetaTrader5
  Moving to c:\python35\lib\site-packages\metatrader5- 5.0 . 4 .dist-info\
   from c:\python35\lib\site-packages\~etatrader5- 5.0 . 4 .dist-info
  Moving to c:\python35\lib\site-packages\metatrader5\
   from c:\python35\lib\site-packages\~-tatrader5
ERROR: Command errored out with exit status 1 : 'c:\python35\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = ' "'" 'C:\\Users\\la
 \\AppData\\Local\\Temp\\pip-install-s2bqudzg\\MetaTrader5\\setup.py' "'" '; __file__=' "'" 'C:\\Users\\la
 \\AppData\\Local\\Temp\\pip-install-s2bqudzg\\MetaTrader5\\setup.py' "'" ';f=getattr(tokenize, ' "'" 'open' "'" ', open)(__file__);code=f.read().replace(' "'" '\r\n' "'" ', ' "'" '\n' "'" ');f.close();exec(compile(code, __file__, ' "'" 'exec' "'" '))' install --record 'C:\Users\la \AppData\Local\Temp\pip-record-7ohhmuga\install-record.txt' --single-version-externally-managed --compile Check the logs for full command output.
 
jaffer wilson:

该库没有安装,甚至没有更新。我目前使用的版本是5.0.4,最新版本是5.0.8。

这是个日志。我应该怎么做?

请重新安装Python(3.7或3.8更好),然后再试一下。

 
MetaQuotes Software Corp. :

请重新安装Python(最好是3.7或3.8),然后再试一下。

我在使用Python 3.5.0。以前的版本运行良好。但最新的更新并没有更新。什么会导致这种情况?

 
jaffer wilson:

我在使用Python 3.5.0。以前的版本运行良好。但最新的更新并没有更新。这可能是什么原因呢?

重新安装Python 3.5.0 x64,再试一次。

 
MetaQuotes Software Corp. :

重新安装Python 3.5.0 x64,再试一次。

谢谢你的答复。我已经这样做了。但问题仍然是一样的。

 
jaffer wilson:

该库没有安装,甚至没有更新。我目前使用的版本是5.0.4,最新版本是5.0.8。

这是个日志。我应该怎么做?

从日志来看,你正试图从源头构建一个模块,你必须有Visual Studio 2017/2019或Visual C++ Build Tools来实现。

试着输入。

pip uninstall MetaTrader5
pip install MetaTrader5

安装应该从WHL开始。

E:\>pip install MetaTrader5
Collecting MetaTrader5
  Downloading https://files.pythonhosted.org/packages/e4/fc/dc782c6b6b1c9270b8efbca08b2304150354a87fff5695671f930af8f0ad/MetaTrader5-5.0.9-cp37-cp37m-win_amd64.whl
Installing collected packages: MetaTrader5
Successfully installed MetaTrader5-5.0.9
 
Almaz :

从日志来看,你正试图从源头构建一个模块,你必须有Visual Studio 2017/2019或Visual C++ Build Tools来实现。

试着输入。

安装应该从WHL开始。

我也试过这样做。但我不明白为什么会发生这种情况。如果我卸载Metatrader并尝试重新安装,我得到了同样的错误。 即使是5.0.4版本。

而且我严格使用Python 3.5.0。