How to install older version of statsmodels - statsmodels

Is there a way to install an older version of statsmodels? Such as using pip install statsmodels x.xx? I cant find any documentation on their website about this. Thanks
I've tried using the current version but encounter errors when running the code. if i use import statsmodels.tsa.arima_model.ARMA i get the following error
statsmodels.tsa.arima_model.ARMA and statsmodels.tsa.arima_model.ARIMA have been removed in favor of statsmodels.tsa.arima.model.ARIMA
When i replace arima_model with arima.model other lines of code will not work such as
` 2 # Build Model
3 model = ARIMA(train_data, order=(1,1,0))
----> 4 fitted = model.fit(disp=-1)
5 print(fitted.summary())
TypeError: fit() got an unexpected keyword argument 'disp'`
I'd like to revert the version of statsmodels so i can get the program to run

Related

TypeError: Updater.__init__() got an unexpected keyword argument 'use_context'

It occurred when I perform this :
updater = Updater('5502935975:AAGcE8wtPOUMXVCOI3PXr0fygpXsdaEn-HI', use_context=True)
Many Thanks!
You should revoke the token that you just posted. Also double check which version of python-telegram-bot you are using and followng the resources that PTB provides for that version.
Disclaimer: I'm currently the maintainer of python-telegram-bot.
"Down grade" or "upgrade" the python-telegram-bot to the relevant version , e.g i downgraded by using "pip install python-telegram-bot==13.7" from the lastest python-telegram-bot 20.0 version, and it worked for me,
NOTE: my version might be different from yours so use the right version that wont call the error

Fault in reticulate in rstudio

476/5000
rstudio generates error when running R code with python code. At first the code worked very well but in the second installation it started to generate faults. Here is the link of the code in case you want to play #https: //www.r-bloggers.com/r-and-python-using-reticulate-to-get-the-best-of-both-worlds/
. My laptop is hp 4 gigs of ram and 500 mb of hard disk.
I would greatly appreciate who can explain the failure and how to solve it.
I have reinstalled anaconda last version twice.
library(reticulate)
use_python("/usr/local/bin/python")
use_virtualenv("r-reticulate")
os <- import("os")
Error: lexical error: invalid char in json text.
WARNING: The conda.compat modul
(right here) ------^
os$listdir(".")
Error: object 'os' not found
py_config()
Error: lexical error: invalid char in json text.
WARNING: The conda.compat modul
(right here) ------^
Actually, it comes from a deprecation warning reported a few days ago (fix compat import showing warning #8507).
But the fact is that this warning in "conda.compat" generates some errors, for example in the case of using conda environments in R through "reticulate" functions. This issue has been reported quite recently Conda warnings taken as errors #477.
The solution is to simply install the github version of "reticulate" in order to avoid these errors and ignore the conda warnings which shouldn't necessarily impede these functionalities. You can do it like this way:
remotes::install_github("rstudio/reticulate")
And don't forget to have the latest Rtools installed in your operating system!
This might be useful for you: https://docs.anaconda.com/anaconda/user-guide/tasks/switch-environment/
I have Anaconda, and set up Python 2 environment. Once activated, run 'use_python' with the path to that environment and set the 'required' parameter to TRUE.
I had the same problem. I solved the problem by installing an older version of conda.
In anaconda promt
conda install conda = 4.1.6

Compile errors when setting up Plone development environment

I'm trying to follow the walkthrough here to produce a new theme for my Plone 5.1 server:
https://training.plone.org/5/theming/theme-package.html
I'm using MacOS 10.13.6 running clang clang-1000.11.45.5 (the one that comes with XCode) and Python 3.6.4 (installed through Anaconda). I've run into some trouble since the buildout script that is produced by mr.bob doesn't appear to contain all of the dependencies, specifically plone.recipe.zope2instance==4.2.22. When I attempt to install that dependency manually, I get the following compilation error:
src/Persistence/_Persistence.c:178:5: error: non-void function 'init_Persistence' should return a value [-Wreturn-type]
return;
^
17 warnings and 7 errors generated.
error: command 'clang' failed with exit status 1
I tried upgrading to the latest version of mr.bob and the templates, then using the plonecli to create and start the buildout, but I get the same compilation errors.
There are many like it in that module. How do I resolve this so I can finish installing that dependency and finish my buildout?
Try to use Python 2.7, it's better supported by Zope and Plone.
Plone is using Python 2.7.x until Version 5.1.
In Plone 5.2 you will have the option to run Plone under Python 3, but then you have to use the WSGI-Server instead of the ZServer. For now just use Plone 5.1 with Python 2.7 as Plone 5.2 is still not finally released.

pyinstaller gives weird errors when compiling pandas

UPDATE june 18:
I would like compiling my python code for windows.
I use to work with pyinstaller, python 3.5+, windows 7 and anaconda to control modules pandas, pyqt (v5) and pyqtgraph, but it seems something is not compatible. I would not be surprised if you tell me to change a version.
In previous versions, it worked with python 3.5, windows 7 and Pyinstaller 3.3.1- without pandas; the new version imports pandas and then this doesn’t work anymore:
with the usual config pyinstaller gives a message saying the C libraries are not built. Following the instructions, I should run python setup.py build_ext --inplace --force, except I don’t see the setup.py file, so I don’t know what to do. Forums tell me it should be a problem with pip but not with conda… but I use conda…
with python 3.6, I got an error message ‘RecursionError: maximum recursion depth exceeded’ (https://github.com/steph2016/profiles/blob/master/errorMessage). This problem seems known and solutions I found on forums is either to downgrade python or to replace my PyInstaller-3.3.1 by PyInstaller-3.4.dev0+7b3143612. But with PyInstaller-3.4.dev0+7b3143612 I get a ’’str’ object has no attribute ‘items’’ error (https://github.com/steph2016/profiles/blob/master/ErrorMessage2). I’m not sure pyinstaller is compatible with python 3.6…
with python 3.4, I got an error similar to the ‘str object’ one above. I’m not sure python3.4 is compatible with qt5…
I would be pleased by any solution with any version of whatever to windows-compile my code
I don't know if it is the issue but I didn't find PyQtGraph in Supported-Packages
I eventually applied the first solution proposed in No module named 'pandas._libs.tslibs.timedeltas' in PyInstaller in the original config (python 3.5, PyInstaller 3.3.1, pyqtgraph, pandas, windows 7,...) and it worked.
I don't know why adding def get_pandas_path ..... a.binaries) helps, so I can't justify. But just to be explicit even if it seems obvious: pyinstaller must be run on the spec file, not on the py one (for instance > pyinstaller toto.spec)

Getting an "invalid syntax" error from __init__.py

I'm following this example for using Flask-JWT:
https://pythonhosted.org/Flask-JWT/
And I get this error when I start uwsgi:
Traceback (most recent call last):
File "./wsgi.py", line 1, in
from main import app as application
File "./main.py", line 5, in
from auth import api_auth
File "./auth.py", line 3, in
from flask_jwt import JWT
File "/opt/mist_base/env/lib/python2.6/site-packages/flask_jwt/__init__.py", line 83
for claim in verify_claims
^
SyntaxError: invalid syntax
I've been only using Python v2.6.6 (for Centos 6.x per customer specification) for only a week so I'm still very green at it. As a result, earlier today I discovered I had multiple variations of JWT-something in my virtualenv so I removed all instances and only reinstalled Flask-JWT. I had thought the issue was library conflicts (and it may have been earlier), but I'm still getting this error and other people have used it with no issues. Am I doing something wrong or is this library simply not designed to be used with Python v2.6.x?
[UPDATE] I've gone ahead and compiled v2.7.12 from source in CentOS 6 and so far it works nicely for my needs. I found these directions:
http://toomuchdata.com/2014/02/16/how-to-install-python-on-centos/
and was able to install in an alternate directory.
This library just doesn't work on Python 2.6. The source code relies on features like dict comprehensions that only exist in 2.7 and up.

Resources