TDengine icon indicating copy to clipboard operation
TDengine copied to clipboard

python package install was failed

Open Laurel-rao opened this issue 7 years ago • 24 comments

I found two error when i was installed connector of python.

Error 1:

  • The error show installation path pip install src/connector/python/python3/ with documentation from link https://www.taosdata.com/en/documentation/connector/#Python-Connector .
  • But the actually path is pip install src/connector/python/windows/python3/ from github project. image

Error 2:

  • The installation with python was failedwhen i use pip install that shows successfully installed.
  • But i use the command import taos, it shows error below.

image

Laurel-rao avatar Jul 31 '19 11:07 Laurel-rao

我也是这个问题,python3 pip能安装成功,但import taos说找不到模块。python2.7能安装成功,但有个报错,错误如下: image image

langxj avatar Jul 31 '19 13:07 langxj

linux no error!

langxj avatar Jul 31 '19 13:07 langxj

For error 1, the installation path to be chosen depends on what system under which your client will be installed. If you want to install the python client under windows, then the installation path is "src/connector/python/windows/python3/". Otherwise, the you will install the python client under linux.

For error2, can you find the taos.dll under "C:\TDengine\driver"?

fangpanpan avatar Aug 01 '19 00:08 fangpanpan

For error 1, the installation path to be chosen depends on what system under which your client will be installed. If you want to install the python client under windows, then the installation path is "src/connector/python/windows/python3/". Otherwise, the you will install the python client under linux.

For error2, can you find the taos.dll under "C:\TDengine\driver"?

我有这个文件,还是报错: image image

ZSCLM avatar Aug 01 '19 07:08 ZSCLM

Have you also copied the tao.dll to "C:\windows\system32"?

fangpanpan avatar Aug 01 '19 08:08 fangpanpan

After I copied the "taos.dll" to "C:\Windows\System32", I tried again and the error still exists, and I also restarted my "cmd".. image image

ZSCLM avatar Aug 01 '19 08:08 ZSCLM

Your windows is 32bit and our tao.dll is compiled on 64bit system.

fangpanpan avatar Aug 01 '19 08:08 fangpanpan

Your windows is 32bit and our tao.dll is compiled on 64bit system.

Great ! That's the problem..

ZSCLM avatar Aug 01 '19 11:08 ZSCLM

Your windows is 32bit and our tao.dll is compiled on 64bit system.

My windows is 64bit, the error still exists. image image image

langxj avatar Aug 02 '19 01:08 langxj

Your windows is 32bit and our tao.dll is compiled on 64bit system.

My windows is 64bit, the error still exists. image image image

I'm confused about your statement "The installation with python was failed" in error 2. Have you succeed after entering "pip install python3"?

Another question, have you copied "tao.dll" to "C:\Windows\System32" and "C:\TDengine\driver"?

fangpanpan avatar Aug 02 '19 01:08 fangpanpan

Your windows is 32bit and our tao.dll is compiled on 64bit system.

My windows is 64bit, the error still exists. image image image

I think there may be two possibilities:

  • First:Your source code is not update to date, I updated my code yesterday and reinstalld the lib, and then the problem was solved.
  • Second:You've installed the wrong lib. You should use the command "pip install /src/connector/python/windows/python3" to install the lib used under windows system. Now your code is trying to load the lib "libtaos.so" which seems to be used under Linux system..

ZSCLM avatar Aug 02 '19 09:08 ZSCLM

Your windows is 32bit and our tao.dll is compiled on 64bit system.

My windows is 64bit, the error still exists. image image image

I think there may be two possibilities:

  • First:Your source code is not update to date, I updated my code yesterday and reinstalld the lib, and then the problem was solved.
  • Second:You've installed the wrong lib. You should use the command "pip install /src/connector/python/windows/python3" to install the lib used under windows system. Now your code is trying to load the lib "libtaos.so" which seems to be used under Linux system..

github lastest code is ok! image

langxj avatar Aug 02 '19 13:08 langxj

I found two error when i was installed connector of python.

Error 1:

  • The error show installation path pip install src/connector/python/python3/ with documentation from link https://www.taosdata.com/en/documentation/connector/#Python-Connector .
  • But the actually path is pip install src/connector/python/windows/python3/ from github project. image

Error 2:

  • The installation with python was failedwhen i use pip install that shows successfully installed.
  • But i use the command import taos, it shows error below.

image

update github lastest code, run "pip install src\connector\python\windows\python3"

langxj avatar Aug 02 '19 13:08 langxj

From the screenshot seems that it's a bug in \taos\cinterface.py, that it tries to load a Linux ELF file (libtaos.so) instead of a Windows PE (libtaos.dll --- unless ctypes.CDLL() does the name-conversion job properly). https://user-images.githubusercontent.com/7477494/62337425-2912b080-b507-11e9-8ebe-5ba7a0d1e28b.png

hong6914 avatar Aug 03 '19 00:08 hong6914

Besides, you guys better install the packages and debug your stuff in a python's virtual environment, and avoid the pollution of the packages over time. There are a few virtual environments and I'd prefer virtualenv :-)

(sudo --- Linux) pip install virtualenv cd virtualenv <your_vent_name> cd <your_vent_name> source bin/activate (---Linux) or bin\activate (---Windows) pip install mkdir src then put your code in it and play with it

Also are you using PyCharm? The community edition is free even in office. The best Python IDE on this planet. Try it :-)

Side note: from the screenshot above --- C:\python36\lib\site-packages\ is the global place to store the packages on your machine. Be careful installing stuff to here

hong6914 avatar Aug 03 '19 00:08 hong6914

我在Windows10上也pip成功了,报同样的错误,只好把代码放到Linux上去运行。 taos.dll不是在开发么?https://github.com/taosdata/TDengine/issues/89

treemp3 avatar Aug 22 '19 02:08 treemp3

我在Windows10上也pip成功了,报同样的错误 1 2 3

mujin-zl avatar Jun 15 '20 07:06 mujin-zl

我在安装python连接器时发现了两个错误。

错误1:

  • 错误显示安装路径pip install src/connector/python/python3/以及link中的文档https://www.taosdata.com/en/documentation/connector/#Python-Connector。
  • 但是实际路径pip install src/connector/python/windows/python3/来自github项目。 图片

错误2:

  • 当我使用python进行安装时失败pip install ,表明安装成功。
  • 但是我使用命令import taos,它显示下面的错误。

图片

更新github最新代码,运行“ pip install src \ connector \ python \ windows \ python3”

同样的错误,请问您解决这个问题了么

mujin-zl avatar Jun 16 '20 01:06 mujin-zl

我在安装python连接器时发现了两个错误。

错误1:

  • 错误显示安装路径pip install src/connector/python/python3/以及link中的文档https://www.taosdata.com/en/documentation/connector/#Python-Connector。
  • 但是实际路径pip install src/connector/python/windows/python3/来自github项目。 图片

错误2:

  • 当我使用python进行安装时失败pip install ,表明安装成功。
  • 但是我使用命令import taos,它显示下面的错误。

图片

更新github最新代码,运行“ pip install src \ connector \ python \ windows \ python3”

同样的错误,请问您解决这个问题了么

It shows the same error.

>>> import taos
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\15627\AppData\Local\Programs\Python\Python36\lib\site-packages\taos\__init__.py", line 2, in <module>
    from .connection import TDengineConnection
  File "C:\Users\15627\AppData\Local\Programs\Python\Python36\lib\site-packages\taos\connection.py", line 1, in <module>
    from .cursor import TDengineCursor
  File "C:\Users\15627\AppData\Local\Programs\Python\Python36\lib\site-packages\taos\cursor.py", line 1, in <module>
    from .cinterface import CTaosInterface
  File "C:\Users\15627\AppData\Local\Programs\Python\Python36\lib\site-packages\taos\cinterface.py", line 138, in <module>
    class CTaosInterface(object):
  File "C:\Users\15627\AppData\Local\Programs\Python\Python36\lib\site-packages\taos\cinterface.py", line 140, in CTaosInterface
    libtaos = ctypes.windll.LoadLibrary('taos')
  File "C:\Users\15627\AppData\Local\Programs\Python\Python36\lib\ctypes\__init__.py", line 426, in LoadLibrary
    return self._dlltype(name)
  File "C:\Users\15627\AppData\Local\Programs\Python\Python36\lib\ctypes\__init__.py", line 348, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: [WinError 126] 找不到指定的模块。

Laurel-rao avatar Jun 16 '20 03:06 Laurel-rao

这个解决方法很简单啊,如果是Windows的话,把taos.dll文件复制一下,在system32和SysWOW64都放一份。 Linux上面也是一样的,在/usr/lib和/usr/lib64下面都放一份taos.so,大概是这样的,时间久了记不太清了。

treemp3 avatar Jun 16 '20 04:06 treemp3