cannot import name 'nosetester' error while importing pandas - pandas

Im getting below error while importing pandas
cannot import name 'nosetester'
Traceback (most recent call last):
File "/usr/bin/anaconda/envs/py35/lib/python3.5/site-packages/pandas/init.py", line 56, in
from pandas.util.nosetester import NoseTester
File "/usr/bin/anaconda/envs/py35/lib/python3.5/site-packages/pandas/util/nosetester.py", line 13, in
from numpy.testing import nosetester
ImportError: cannot import name 'nosetester'
Pandas version ->0.18.1
Numpy version ->1.18.0
Any help to resolve the error?

One approach is to use python 3.6 version like 3.6.5 is a stable version.
Another approach is if you want to continue in python 3.5 version itself then python 3.5.2 it worked correctly.

Related

hello i am new to python. i installed matplotlib in my Visual studio but whenever i try to run the file it displays the error

I wanted to plot a graph. but suddenly i could not because of the import error. yet i have installed matplotlib and numpy.
Traceback (most recent call last):
File "c:\Users\user\Documents\plot.py", line 1, in
from matplotlib import pyplot as plt
File "C:\Users\user\AppData\Roaming\Python\Python311\site-packages\matplotlib_init_.py", line 109, in
from . import _api, _version, cbook, docstring, rcsetup
File "C:\Users\user\AppData\Roaming\Python\Python311\site-packages\matplotlib\rcsetup.py", line 27, in
from matplotlib.colors import Colormap, is_color_like
File "C:\Users\user\AppData\Roaming\Python\Python311\site-packages\matplotlib\colors.py", line 56, in
from matplotlib import _api, cbook, scale
File "C:\Users\user\AppData\Roaming\Python\Python311\site-packages\matplotlib\scale.py", line 23, in
from matplotlib.ticker import (
File "C:\Users\user\AppData\Roaming\Python\Python311\site-packages\matplotlib\ticker.py", line 136, in
from matplotlib import transforms as mtransforms
File "C:\Users\user\AppData\Roaming\Python\Python311\site-packages\matplotlib\transforms.py", line 46, in
from matplotlib._path import (
ImportError: DLL load failed while importing _path: The specified module could not be found.
PS C:\Users\user\Documents>
I figured it out.
If you have already installed matplotlib, but the error still comes about. Then you have to download Microsoft C++ from their website.
https://www.microsoft.com/en-US/Download/confirmation.aspx?id=48145
install Microsoft c++ then you can try again to run your code.
it has worked for me like magic.
I got the solution from a youtube video.
link here.
https://www.youtube.com/watch?v=DpwsvUkNAmg

Cannot import sentinelsat python module

I am a python newbie and am trying to get the sentinelhub module to work but have been receving this error message on my code:
import sentinelhub
Traceback (most recent call last):
File "<pyshell#0>", line 1, in
import sentinelhub
ImportError: No module named sentinelhub
After I've downloaded the module using "pip install sentinelhub" on the windows command. I am currently using Python version 2.7.18. Any suggestions would be helpful. Thanks.
It looks like sentinelhub requires a different version of Python.
From their own website they specify that it "requires Python >=3.7"
https://sentinelhub-py.readthedocs.io/en/latest/install.html

Matplotlib version 3.3.0 causes ft2font DLL ImportError

I recently upgraded matplotlib from version 3.2.2 to 3.3.1. When I tried to import matplotlib I got the following error message:
>>> import matplotlib.pyplot as plt
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "E:\SWIM\test\venv\lib\site-packages\matplotlib\__init__.py", line 174, in <module>
_check_versions()
File "E:\SWIM\test\venv\lib\site-packages\matplotlib\__init__.py", line 159, in _check_versions
from . import ft2font
ImportError: DLL load failed: The specified module could not be found.
When googling for answers, most of them recommended downgrading matplotlib. But the results were many years old, and I don't feel like downgrading. I want the latest version to just work.
Turns out I had Microsoft Visual C++ 2008 Redistributable installed, and I didn't have any newer version. By installing the latest 2015-2019 edition, my problem was solved (Downloads can be found here).

beautifulSoup 4 works on python2.6?

I'm trying to do a web scraping project using bs4, but on the remote server they have python 2.6.6 installed.
Can I work with bs4 on python2.6.6?
I already tried but got these errors:
Traceback (most recent call last):
File "/home/infoforense/public_html/citius-scraping.py", line 16, in <module>
from bs4 import BeautifulSoup
File "/usr/lib/python2.6/site-packages/bs4/__init__.py", line 34, in <module>
from .builder import builder_registry, ParserRejectedMarkup
File "/usr/lib/python2.6/site-packages/bs4/builder/__init__.py", line 7, in <module>
from bs4.element import (
File "/usr/lib/python2.6/site-packages/bs4/element.py", line 12, in <module>
import soupsieve
File "/usr/lib/python2.6/site-packages/soupsieve/__init__.py", line 29, in <module>
from .__meta__ import __version__, __version_info__ # noqa: F401
File "/usr/lib/python2.6/site-packages/soupsieve/__meta__.py", line 190, in <module>
__version__ = __version_info__._get_canonical()
File "/usr/lib/python2.6/site-packages/soupsieve/__meta__.py", line 146, in _get_canonical
ver = "{}.{}.{}".format(self.major, self.minor, self.micro)
ValueError: zero length field name in format
I am the author of the failing dependency soupsieve, and can verify that soupsieve does not support Python 2.6.
It is possible that that an earlier version of Beautiful Soup (before 4.7) does fully support Python 2.6, but I'm not sure.
Python 2.6 is such an old version that even the Python team has stopped supporting it.
You could try installing older versions of Beautiful Soup and see if one of them allow you to move forward, but I can confirm that the latest versions, at least 4.7 and above, will not work on Python 2.6.

Julia PyPlot segments

This question is related to the already asked question:
Julia error using PyPlot - signal (11): Segmentation fault
However, it is not entirely clear to me what the solution there was, or whether even the steps there apply also to my case (I tried them with no effect).
I have been using Julia 4.6 for some time without any problems.
I then decided to update my Ubuntu distribution from 14 to 16.04.
This is when PyPlot stopped working.
I have updated the Julia Packages, and I also did Pkg.build("PyPlot") to no effect. I also run Pkg.test("PyCall") and it passes all tests succesfuly. I also tried the suggestion
ENV["PYTHON"] = ""; Pkg.build("PyPlot")
The situation right now is the following.
I can import PyPLot normally:
using PyPlot
This gives me no errors.
However, as soon as I invoke any command relating to PyPlot, like:
figure()
I receive the error:
signal (11): Segmentation fault
unknown function (ip: 0x32736)
Segmentation fault (core dumped)
and Julia exits of course.
I don't know if this is relevant, but out of curioustiy I tried the following thing. After starting python in the command line, I do:
import matplotlib.pyplot
which gives me the following error message:
RuntimeError: module compiled against API version 0xa but this version of numpy is 0x9
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/dist-packages/matplotlib/pyplot.py", line 29, in <module>
import matplotlib.colorbar
File "/usr/lib/python2.7/dist-packages/matplotlib/colorbar.py", line 34, in <module>
import matplotlib.collections as collections
File "/usr/lib/python2.7/dist-packages/matplotlib/collections.py", line 27, in <module>
import matplotlib.backend_bases as backend_bases
File "/usr/lib/python2.7/dist-packages/matplotlib/backend_bases.py", line 62, in <module>
import matplotlib.textpath as textpath
File "/usr/lib/python2.7/dist-packages/matplotlib/textpath.py", line 15, in <module>
import matplotlib.font_manager as font_manager
File "/usr/lib/python2.7/dist-packages/matplotlib/font_manager.py", line 58, in <module>
from matplotlib import ft2font
ImportError: numpy.core.multiarray failed to import
All help appreciated.
EDIT:
I fixed the problem in python with the import statement by simply uninstalling and reinstalling matplotlib via pip. However, this changed nothing for Julia.
In the end I managed to solve the problem with the help of a colleague.
I first re-installed matplotlib via pip.
I had to point Julia to the system installed Python:
ENV["PYTHON"]="/usr/bin/python"
I then rebuilt PyCall and PyPlot:
Pkg.build("PyCall")
Pkg.build("PyPlot")
Restarted Julia and it worked!