Having an issue with Y Finance after upgrading some unrelated stuff - python

I use Y Finance to download data
It was working fine, but is now producing this error message.
Can anyone shine some light on this?
enter image description here
AttributeError: 'Index' object has no attribute 'tz_localize'
I am not sure what the above error means, but all I have done to change things is to update Juypter via Conda and also used the command
"jupyter notebook --NotebookApp.iopub_data_rate_limit=1.0e10 "
as I was having issues installing fbprophets
Can anybody help?
Thanks

this appears to be an issue with the new version of pandas according to the YFinance github issue here. The way to currently get around this is by installing an older version of pandas like so pip install pandas==1.3.5

Related

Kernel error in Jupyter Notebook; unable to install pywin32-postinstall

I know that people already did topics on similar question and most of them I've already read, but it still didn't solve my problem, so I hope I could find help here.
I'm new to Python and faced with the same problem of Kernel Error in Jupyter Notebook as it was described here:
Getting kernel error while trying to open Jupyter notebook or Spyder
I use Miniconda and python 3.9 already installed.
I've tried to implement advice that in that topic, but after I installed pywin32, I've faced with the problem of installing pywin32_postinstall. Every time I try to run it, in the output printed "PackagesNotFoundError: The following package are not available from current channels"
(Sorry, but I'm unable to provide complete piece of code, case I don't know how to cope from Anaconda PowerShell Promt)
I would be so much thankful if anyone could help me with this issue!

Error import with 'shamilton_filter_log' from 'statsmodels.tsa.regime_switching._hamilton_filter'

I tried to compile MarkovSwitching.py from statsmodels (link description here) in python, but I have the follwoing error,
ImportError: cannot import name 'shamilton_filter_log' from 'statsmodels.tsa.regime_switching._hamilton_filter' (C:\Users\myuser\Anaconda3\lib\site-packages\statsmodels\tsa\regime_switching\_hamilton_filter.cp37-win_amd64.pyd)
And I don't kown how solve this. Furthermore, I upgrade the statsmodels using '' pip install statsmodels --upgrade'', but doesn't work.
I don't know how to solve this problem, any help is welcome!
Thanks!
It's very hard to tell from your description what might be going wrong, since there could be many problems with your setup.
It looks like maybe you have installed Statsmodels v0.10 via Conda or pip and have then downloaded the development version of markov_switching.py. The development version has new functions that v0.10 does not have, and this is my guess about why you are getting the error.
You might try installing the release candidate of v0.11, using: pip install statsmodels==0.11.0rc1.

Encountering Import Error DLL load failed constantly

I have been trying to intall scikit-learn and pytorch using their respective commands given in the docs:
The commands for installing PyTorch are:
1) pip3 install https://download.pytorch.org/whl/cpu/torch-1.0.1-cp37-cp37m-win_amd64.whl
2) pip3 install torchvision
The command for installing scikit-learn is:
pip install -U scikit-learn
Some background:
I am using Windows 8.1, Python 3.7.2. My pip is updated. I have also installed Anaconda for solving this using conda, but had zero luck!(Also, here I am running into 'conda' unrecognized error which is another story). Here are the paths my PATH variable holds.
PATH
C:\Users\satya\Anaconda3;
C:\Users\satya\Anaconda3\Library\mingw-w64\bin;
C:\Users\satya\Anaconda3\Library\usr\bin;
C:\Users\satya\Anaconda3\Library\bin;
C:\Users\satya\Anaconda3\Scripts;
C:\Users\satya\AppData\Local\Programs\Python\Python37\Scripts\;
C:\Users\satya\AppData\Local\Programs\Python\Python37\; C:\Users\satya\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Python 3.7
The Actual Problem:
The same commands for installation given above work perfectly fine on my other Windows 10, but, for my Windows 8.1 it gives this error which has become a real PITA
Import Error: DLL load failed The specified module could not be found
When I import sklearn or import torch I get the exact same error. All the time.
Back Story:
I have searched almost all the related questions I could find on Stackoverflow and Github for 6+ hours to help me solve this problem. But, none of the answers have helped till now and some haven't had an "understandable" answer. Maybe, its just a small fix, but now, I am choosing to post a question on SO.
My Question Again:
Can someone please help out and try to explain what I am missing out here? I really want to fix this error for good(and want to be in a position to fix it if I encounter it again). An elaborate answer would really help understand easily.
Thank You!
Please check your python build number with the following command.
conda list python
Python 3.7.2 with build number h8c8aaf0_2 has a solved issue.
If this is the case, an update will do.
conda update python

"function 'AddDllDirectory' not found" while importing pytorch

I keep getting this error while trying to import pytorch in jupyter notebook
import torch
AttributeError: function 'AddDllDirectory' not found
this error occur only when I try installing pytorch in anaconda (I used both command to install pytorch pip and conda, I also tried installing only the cpu version and nothing changed, i still get the same error while trying to import it)
I searched the internet and found nothing remotely close to my problem.
is there's a way I can fix this error?
thanks in advance
I fixed the issue by installing the file (KB2533623) from
Here (for windows 7 users). this file apparently contains the missing "AddDllDirectory" function.
Posting this answe in case someone ran into the same problem.

Importing matplotlib.pyplot fails in PyCharm due to AttributeError: module 'PyQt5.QtGui' has no attribute 'QApplication'

I wanted to change my python compiler to "newer" one (within one project) and use some additional packages with conda. After the installation all my packages worked fine and I could use the console, however matplotlib.pyplot fails to import since then. And throws the following error: app = QtGui.QApplication([" "])
AttributeError: module 'PyQt5.QtGui' has no attribute 'QApplication'
After doing some research on this I found this one: link
It is suggesting to change inputhooks.py (on line 513 and change GUI_QT:enable_qt4 to GUI_QT: enable_qt5 4 to 5)
As it is a company machine, I can't have admin rights to overwrite things within PyCharm.
Can you recommend a better solution to avoid this?
Why is this popping up?
ErrorLogScreenshot
Also I tried to install the newer version of pyqt but that didn't fix the problem.
In the same time
Within pydev the interactiveshell.py fails as well. with the following error message:self.showtraceback(running_compiled_code=True)
TypeError: showtraceback() got an unexpected keyword argument 'running_compiled_code'
I understand it gets an argument which it is not expecting. I did some research on this one as well and some could fix it by deleting a stale a corresponding .pyc file (I couldn't find one at the same location as the initial file only interactiveshell.py)
Below this blog regarding pydev the conversation never went further
https://github.com/ipython/ipython/issues/10687
Is there a way to fix it?
I am kind of new to Python and don't quite understand the heart of it at this depth so any help is appreciated.
Thanks,
Anna
For anyone having the same issue, I have solved this problem by switching to qt and pyqt 4. To do so, follow the following procedure:
conda remove qt
conda install qt=4
conda install -c anaconda pyqt=4.11.4
conda install matplotlib --no-update-dependencies
If you are not using a virtual environment, you might also have to remove anaconda navigator before installing new packages:
conda uninstall anaconda-navigator
At the beginning of your program, switch matplotlib backend:
import matplotlib.pyplot as plt
plt.switch_backend('Qt4Agg')
Inspired by this solution.
After updating PyCharm all issues seem to have been resolved. (I was using versin 2017.1)
The show traceback error was due to pydev, and the new release fixes it.
As well as the GUI problem.
I was able to solve it by finding the file, and both messages disappeared, and matplotlib seems to work fine again.
Under this folder (I named my environment py35):
C:\Users\myusername\AppData\Local\Continuum\anaconda3\envs\py35\Lib\site-packages\IPython\core__pycache__
I found the file: interactiveshell.cpython-35.pyc and deleted it -
(This solves the problem only on Python 3.5)

Categories