influxdata / influxdb-python

Python client for InfluxDB
MIT License
1.7k stars 522 forks source link

ModuleNotFoundError when calling influxdb in ipython #839

Closed josesoyo closed 4 years ago

josesoyo commented 4 years ago

Hello, I am trying to use influxdb in ipython but when I call it, an error message says that the module is not found. Instead, if I try to call it in python, within the same environment, it works perfectly.

influxdb problem

I have installed influxdb-python using conda-forge. If I try to install influxdb using pip install influxdb I get:

WARNING: No metadata found in c:\programdata\anaconda3\envs\avint\lib\site-packages ERROR: Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory: 'c:\programdata\anaconda3\envs\avint\lib\site-packages\pytz-2020.1.dist-info\METADATA'

some extra data:

sakethramanujam commented 4 years ago

The python versions shown in the picture seem to be different, the ipython shell shows the python version to be 3.7.6 where as your regular python environment shows it to be 3.7.7. May be they're on different environments altogether.

josesoyo commented 4 years ago

Yes, I don't know why within the same environment, python and ipythonhave different pythonversions. But they are working in the same environment.

I think the problem is related with ipython, but I was hoping that someone found similar problems.

The python versions shown in the picture seem to be different, the ipython shell shows the python version to be 3.7.6 where as your regular python environment shows it to be 3.7.7. May be they're on different environments altogether.

josesoyo commented 4 years ago

Thanks

The python versions shown in the picture seem to be different, the ipython shell shows the python version to be 3.7.6 where as your regular python environment shows it to be 3.7.7. May be they're on different environments altogether.

Thanks @sakethramanujam , after checking it more it results you are right. Altough I was activating the environment the ipython and jupyter were from the base envirnment. For this reason it was not working.

I found some related questions in the ipython repository and this was the solution in case someone finds the same problem: https://github.com/ipython/ipython/issues/10986#issuecomment-418439436

sakethramanujam commented 4 years ago

Oh okay! good to know! Also, thanks for sharing the solution here.