I am working on a project and it was working fine until I decided to update all the packages in my virtual environment of Pycharm. Now it's giving me error on the function that was working fine before. I'm getting
'SVC' object has no attribute '_probA'
on this line of code
pickle.loads(open(rec, "rb").read()).predict_proba(vec)[0]
Is there a way to rollback packages updates or what is the new attribute which will work?
Can you remove the package and reinstall? The installation screen gives you the option to 'Specify Version'.
Related
I am getting error for module dynamodb2 in boto but the module exists in my venv. Other modules in venv are recognized without any issues, only boto/dynamodb2 appears to have problem. I looked at similar issues posted on Stackoverflow such as this one python is not finding my installed modules in venv but none matched my situation. Any ideas what may be wrong?
It turned out to be an issue with Pycharm version I was using. I encountered above problem while using PyCharm community version 2022.2.2. I had an older PC where I did not get the library import error above. The version used was community 2020.2.4. So I installed the same on my new PC the error went away. Still don't quite understand why newer Pycharm would give the error and older version will not.
I am following the pynomo installation steps in order to use their code.
I installed Anaconda, tried to run the code and it said there was an attribute error - object has no attribute 'texoutput'.
I realised I had to install Tex Live for this to work but even after installing I still get the same error message.
I'm very new to this so I am unsure how to properly set it up for it to work.
Here is there instructions:
enter image description here
I am using Spyder 4.1.5 with Python 3.8.5 with Anaconda
When trying to show the content of a variable in Spyder i get the following error
Spyder is unable to show the variable you are trying to view because the module spydercustomize was not found in your Spyder environment. Please install this package in your Spyder environment.
A simple pip install spydercustomize does not work
I don't even know why it is missing. I think the problem occured the first time when I tried to update Spyder. A reinstallation of Anaconda didn't help either.
My Google skills were not good enough to find any solution. I only find problems where variables don't show in the variable explorer. But that is not my problem.
Btw, built in classes like lists or dicts can be displayed, custom classes can't.
I appreciate your help!
EDIT
After updating to Spyder 4.2.0 I got the following error:
Spyder was unable to retrieve the value of this variable from the
console.
The error message was: An error occured, see the console.
Note: Please don't report this problem on Github, there's nothing to
do about it.
Console is empty
Looks like spydercustomize is part of a package called spyder-kernels. Maybe try:
$ pip install spyder spyder-kernels --upgrade
I am using Pycharm, with python 3.8 and I am watching a flask tutorial for beginners. this means that I am a beginner so I might not understand every vocab or solution, however, a little research on my end will make it alright.
So the problem I am having is that I downloaded flask_sqlalchemy with the following code on the PyCharm terminal:
pip install Flask-SQLAlchemy
I thought I had been successful since the event log also said installation successful. However, when I wrote the following code:
from flask_sqlalchemy import SQLAlchemy
it reported "unresolved reference flask_sqlalchemy"
I then tried entering this in the terminal thinking it would work:
pip install -U Flask-SQLAlchemy
Nothing changed.
I tried installing SQLAlchemy to see if it would do something but it didn't.
I used the following code in the terminal:
pip install SQLAlchemy
Any ideas on how to get this to work?
Go to File -> Preferences -> Python Interpreter. Hit the plus button and install the package SQLAlchemy.
If that does not work, go to File -> Invalidate Cache.
What finally worked for me was deleting the venv folder, deleting the interpreter, and creating a new one. Make sure to enable inheritance of global packages because when you use pip3 install Flask-SQLAlchemy it installs to the default interpreter.
You really should be able to install it to your virtual environment. But I spent 3hrs on it and couldn't figure out how.
If you're still stuck, refer to "Python shows unresolved references error for valid code.
I'm running Django 2.2, python 3.6.7 and I'm working in a virtual environment on Ubuntu 18.04.
Having done a tutorial where the project "mysite" was built, I'm now doing another exercise to build an API. I'm using the same virtualenv. However when I migrate in my new project, call it tutorial, I get ModuleNotFoundError: No module named 'mysite'.
So I deleted mysite. And I get the same error. And then I deleted the parent directory, recreated it (obviously not including mysite) and get the same error. I've searched recursively the codebase and the virtualenv and "mysite" does not turn up.
What's going on here?
You need to set DJANGO_SETTINGS_MODULE/PYTHON_PATH environment variables.