Running vispr throws EmptyDataError when importing pandas.io.common - python-3.x

I'm trying to run the tool vispr in able to visualize the results of the mageck-vispr run.
I have installed everything as explained on the website within a conda environment.
Unfortunately, when running the command
vispr server results/GSC.vispr.yaml
it throws an error
Traceback (most recent call last):
File "/fs/home/yeroslaviz/miniconda3/bin/vispr", line 6, in <module>
from vispr.cli import main
File "/fs/home/yeroslaviz/miniconda3/lib/python3.7/site-packages/vispr/__init__.py", line 12, in <module>
from vispr.results import Screens, Screen
File "/fs/home/yeroslaviz/miniconda3/lib/python3.7/site-packages/vispr/results/__init__.py", line 15, in <module>
from vispr.results import rna
File "/fs/home/yeroslaviz/miniconda3/lib/python3.7/site-packages/vispr/results/rna.py", line 14, in <module>
from pandas.io.common import EmptyDataError
ImportError: cannot import name 'EmptyDataError' from 'pandas.io.common' (/fs/home/yeroslaviz/miniconda3/lib/python3.7/site-packages/pandas/io/common.py)
From what I could find online, this exception might happens, when trying to read an empty file, but all the entries listed in the called GSC.vispr.yaml file exists and are not empty.
I would appreciate it, if someone can help me narrow down the problem or offer a solution.
thanks

I am not sure if the solution I have found is the right one, but all I did is to comment out line 14 in rna.py
import pandas as pd
# from pandas.io.common import EmptyDataError
import numpy as np
Now vispr is working.

Related

Numpy related Error while running a docker container

I composed a docker image file that gets built successfully.
However, when I run a container with that image, it produces the following numpy error and exits.
Any idea how this could be corrected?
ERROR:
Traceback (most recent call last):
File "/opt/venv/lib/python3.9/site-packages/numpy/core/__init__.py", line 22, in <module>
from . import multiarray
File "/opt/venv/lib/python3.9/site-packages/numpy/core/multiarray.py", line 12, in <module>
from . import overrides
File "/opt/venv/lib/python3.9/site-packages/numpy/core/overrides.py", line 7, in <module>
from numpy.core._multiarray_umath import (
ImportError: Error loading shared library ld-linux-x86-64.so.2: No such file or directory (needed by /opt/venv/lib/python3.9/site-packages/numpy/core/_multiarray_umath.cpython-39-x86_64-linux-gnu.so)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/src/app/./MetReTrim", line 14, in <module>
import matplotlib.pyplot as plt
File "/opt/venv/lib/python3.9/site-packages/matplotlib/__init__.py", line 107, in <module>
from . import _api, cbook, docstring, rcsetup
File "/opt/venv/lib/python3.9/site-packages/matplotlib/cbook/__init__.py", line 28, in <module>
import numpy as np
File "/opt/venv/lib/python3.9/site-packages/numpy/__init__.py", line 150, in <module>
from . import core
File "/opt/venv/lib/python3.9/site-packages/numpy/core/__init__.py", line 48, in <module>
raise ImportError(msg)
ImportError:
IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!
Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.
We have compiled some common reasons and troubleshooting tips at:
https://numpy.org/devdocs/user/troubleshooting-importerror.html
Please note and check the following:
* The Python version is: Python3.9 from "/opt/venv/bin/python"
* The NumPy version is: "1.21.2"
and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.
Original error was: Error loading shared library ld-linux-x86-64.so.2: No such file or directory (needed by /opt/venv/lib/python3.9/site-packages/numpy/core/_multiarray_umath.cpython-39-x86_64-linux-gnu.so)
Did you install numpy outside of docker, and copied the venv?
If so, C extensions were compiled for your host (which, according to the error, is not Linux)
You'll need to install numpy into the container itself

Matplotlib and numpy import don't work after pycharm 2019 optimize imports

I used Pycharm 2019.1's import optimization on a full project and now the imports for matplotlib and numpy don't work.
Here is the full error code:
Traceback (most recent call last):
File "C:/Users/LENOVO/PycharmProjects/CSinternal/LearnIt.py", line 8, in <module>
import matplotlib
File "C:\Users\LENOVO\PycharmProjects\CSinternal\venv\lib\site-packages\matplotlib\__init__.py", line 139, in <module>
from . import cbook, rcsetup
File "C:\Users\LENOVO\PycharmProjects\CSinternal\venv\lib\site-packages\matplotlib\cbook\__init__.py", line 31, in <module>
import numpy as np
File "C:\Users\LENOVO\PycharmProjects\CSinternal\venv\lib\site-packages\numpy\__init__.py", line 141, in <module>
from . import core
File "C:\Users\LENOVO\PycharmProjects\CSinternal\venv\lib\site-packages\numpy\core\__init__.py", line 37, in <module>
from . import multiarray
File "C:\Users\LENOVO\PycharmProjects\CSinternal\venv\lib\site-packages\numpy\core\multiarray.py", line 20, in <module>
from . import overrides
File "C:\Users\LENOVO\PycharmProjects\CSinternal\venv\lib\site-packages\numpy\core\overrides.py", line 45, in <module>
""")
RuntimeError: implement_array_function method already has a docstring
I'm new here and honestly don't know what this ( RuntimeError: implement_array_function method already has a docstring) means.
Any help is much appreciated.
I had the same issue and the solution for me appeared when I realized that I had imported torch as two different names in different files in the same project. By renaming them I got rid of the error. I suspect you might have a similar issue. Try running the code in a new project without any other files in the same project.

Yaml with Python 3

I have a python3.6 virtual environment. I an trying to run some keras code and came across this error:
Traceback (most recent call last):
File "test.py", line 4, in <module>
from keras import backend as K
File "Keras-2.0.8/keras/__init__.py", line 4, in <module>
from . import activations
File "Keras-2.0.8/keras/activations.py", line 6, in <module>
from .engine import Layer
File "Keras-2.0.8/keras/engine/__init__.py", line 3, in <module>
from .topology import InputSpec
File "Keras-2.0.8/keras/engine/topology.py", line 8, in <module>
import yaml
File "Keras-2.0.8/yaml/__init__.py", line 2, in <module>
from error import *
ModuleNotFoundError: No module named 'error'
I saw a few other posts regarding this but those all suggest that the problems may be that I am using the python 2.7 version for python3. However, I don not think this is the case since I am in a python 3.6 virtual environment.
I also saw some comments about re-installing/upgrading yaml with python3.6 specifically. I thought doing a pip install in the virtual environment would fix this but it did not seem to help. Any suggestions regarding how to resolve this issue would be much appreciated.
Side Note: the code I am trying to run is test.py from this repo when I come across the error.

how am i able to import matplotlib without an error

i have tried several times to import matplotlib and remove reinstall all of the possible combinations
i am using conda as package management system, and pip points to conda
trying to run following programm:
import matplotlib.pyplot as plt
or just:
import matplotlib
creates following result:
Traceback (most recent call last):
File "C:/Users/Name/IdeaProjects/zzArchiv/Robot project/RobotProject/DeepLearning/approaches/hvasstutorial/anothermain.py", line 22, in <module>
import matplotlib.pyplot as plt
File "D:\ProgramData\Anaconda3\lib\site-packages\matplotlib\__init__.py", line 127, in <module>
from . import cbook
File "D:\ProgramData\Anaconda3\lib\site-packages\matplotlib\cbook\__init__.py", line 2640, in <module>
class _StringFuncParser(object):
File "D:\ProgramData\Anaconda3\lib\site-packages\matplotlib\cbook\__init__.py", line 2652, in _StringFuncParser
_funcs['quadratic'] = _FuncInfo(np.square,
AttributeError: module 'numpy' has no attribute 'square'
i googled a lot and searched left and right, but couldn't get any working solutions (most tell to remove and reinstall numpy/matplotlib which i did several times) please help, if you have any clues
thanks

Can't import cv2 in Python 2.7 linux

I'm trying to get OpenDroneMap to run on my linux mint machine. I've been working my way through a number of problems in the current release's dependency chain.
At the moment, I'm stumped on getting the OpenCV module, cv2 to import.
OpenCV is required by an OpenDroneMap dependency, OpenSfM and it's one of the OpenSfM py files that tries to import the module cv2.
Anyway, running OpenDroneMap generates the error:
Traceback (most recent call last):
File "~/OpenDroneMap/src/OpenSfM/bin/opensfm", line 10, in <module>
from opensfm import commands
File "~/OpenDroneMap/src/OpenSfM/opensfm/commands/__init__.py", line 3, in <module>
import extract_metadata
File "~/OpenDroneMap/src/OpenSfM/opensfm/commands/extract_metadata.py", line 5, in <module>
from opensfm import dataset
File "~/OpenDroneMap/src/OpenSfM/opensfm/dataset.py", line 12, in <module>
import cv2
ImportError: dynamic module does not define init function (PyInit_cv2)
b
quitting cause:
PYTHONPATH=~/OpenDroneMap/lib/python2.7/dist-packages "~/OpenDroneMap/src/OpenSfM/bin/run_all" opensfm
returned with code 256.
From what I can tell, the import error cause typically suggests that the cv2 module was not found. I've ensured that cv2.so does exist in the path specified, as well as the usr/lib/python27/dist-packages path, where it seems to me it should really be looking...
In any case, I was hoping someone might be able to give me some direction on what to try next.

Resources