I have been receiving this error in several python based projects including my current one Shuup and i'm not sure how to resolve it. I have research other errors but none speak about this one. Any help to steer me in the right direction would be great.
It is a issue on django-enumfields that occurs on Python 3.9.2+, according to this.
You can update this lib to a new version, but there is a risk of incompatibility (shuup 3.1 requires "django-enumfields>=2.0.0,<2.1").
Try this:
pip install django-enumfields==2.1.1
Related
I am trying to set up mlops for Vertex AI, following this notebook. It works until, near the end, I try:
vertex_ai.init(
project=PROJECT,
location=REGION)
which gives:
module 'google.cloud.aiplatform.constants' has no attribute 'SUPPORTED_REGIONS
I am using us-central1 which is supported. I wondered if maybe from google.cloud import aiplatform as vertex_ai has been changed but don't know how to find out. Any help is much appreciated.
I followed the same Notebook as you, even though I didn't have any issue. What could be happening to you is that you are using an older version of the library.
You can use the command to upgrade the library that is the following one: pip3 install google-cloud-aiplatform --upgrade.
Sometimes this happens with the basic installation of the library; the problems could be in the dependencies, versions and indirectly permissions.
I used to use GoogleTrans but this has stopped working with this error
AttributeError: 'NoneType' object has no attribute 'group'
I then found this article googletrans stopped working with error 'NoneType' object has no attribute 'group'
I then tried to use the version by running pip install googletrans==3.1.0a0
However, as I am using Python 2.7 it does not seem to work. I am writing an Agent for Plex and therefore, I am tied in with Python 2.7..
Does anyone know of any translation libraries that still work with Python 2.7??
Have you tried installing google-cloud-translate==2.0.1?
See here under "Deprecated Python Versions"
https://pypi.org/project/google-cloud-translate/
I ended up using this library - free to use and no need to register for a licence or key....
https://pypi.org/project/doodle-translate/
to install
pip install doodle-translate
utils/frontend/urls.py
from utils.frontend import views
#more stuff
views.FrontEndTestingStart.as_view()
utils/frontend/views.py
class FrontEndTestingStart(APIView):
python reports
AttributeError: 'NoneType' object has no attribute 'FrontEndTestingStart'
As if views.py would return None when importing.
Why is that?
I have a __init__.py in the directory
The object instance in FrontEndTestingStart is returning None. Hence the issue. For further clarification see these answers - https://stackoverflow.com/a/8949265/5911972 and https://stackoverflow.com/a/8949272/5911972
Here's what got my problem fixed - but I don't know why.
Thanks to #2ps and #rohittk239, of cournse they are both right, but I couldn't find out WHAT exactly was causing that behaviour. Thanks both for trying to help.
I am trying to help a client run a software they bought. It's built on django 1.6.2 (yes I know it's dinosaur).
It had been configured on a long list of dependencies in requirements.txt. Most of them were fixed at a specific version with ==, but some were not, and were on >=. When I then ran pip install -r requirements, this of course would install newer versions than the ones specified everywhere where there was a >= dependency.
Fixing the requirements.txt for all dependencies to == fixed the problem. Looks like some dependency in a later version would create a conflict.
I'm using Gramps 3.3.1 under Ubuntu 12.04 and trying to in Django Export/Import. The install is okay, but when I look at the installed addons, it says that it failed, with reason: "No module named web.settings".
I cann't for the life of me figure out how to fix this. I'm assuming that it's this line in the python script:
import web.settings as default_settings
Anyone have any ideas? I'm trying to get this data out and into a MySQL database, but I can't seem to.
Thanks!
When you run into an error where Python tells you "No module named blah" it really means it can't find "blah".
I would check your pythonpath and the filesystem permissions on the stuff in your path.
Edit
Your issue seems to be a known issue: http://www.gramps-project.org/bugs/view.php?id=5464
It's caused by not running Gramps from source, near as I can tell. It doesn't look like a Python Path issue, so much as the Gramps Django devs making assumptions where your Django settings would be (but I could be wrong).
As for Python Path, there's plenty of resources describing how to. The simplest way to check your Python path is to run echo $PYTHONPATH in a terminal. If you don't see it there, Python might not find it.
Does anyone have any experience with trying to install cairo for django using buildout?
It will install pycairo or py2cairo (the first is for python >3.0, the latest is for python 2.6, which I Am using)
I found 2 recipes to use for installation, both of them gives me errors, in buildout.cfg I have them as 2 parts (of course tried them seperately, not thogether).
The errors are totally different, but the result is the same: I can't get cairo installed using buildout.......
based on: http://pypi.python.org/pypi/tl.buildout_gtk/
[cairo_tl]
recipe = tl.buildout_gtk
#pycairo-url = http://cairographics.org/releases/py2cairo-1.10.0.tar.bz2
pycairo-url = http://cairographics.org/releases/py2cairo-1.8.10.tar.gz
pycairo-md5sum = http://cairographics.org/releases/py2cairo-1.8.10.tar.gz.md5
based on: https://bitbucket.org/lgs/yaco.recipe.pycairo
[cairo_yaco]
recipe = yaco.recipe.pycairo
find-links = http://pypi.python.org/pypi/yaco.recipe.pycairo/0.1.1
#find-links = http://pypi.python.org/pypi/yaco.recipe.pycairo/0.1
# pkg-config-path ?
Both need a local install of cairo (pycairo and py2cairo depend on this):
so use on the server:
sudo apt-get install libcairo2-dev
The part jusing tl.buildout_gtk:
Either using the py2cairo-1.10.0 or pycairo-1.8.2 gives me a MD5 checksum mismatch
(see for available releases: http://cairographics.org/releases/)
e.g:
Error: MD5 checksum mismatch downloading 'http://cairographics.org/releases/py2cairo-1.10.0.tar.bz2'
or:
Error: MD5 checksum mismatch downloading 'http://cairographics.org/releases/py2cairo-1.8.10.tar.gz'
The part jusing yaco:
I Am pretty sure this part is not configured correctly (pkg-config-path refering to the local cairo package), but I do not even get to that point.
It gives an error:
DistributionNotFound: zc.recipe.cmmi
However, this is installed in the eggs
By the way, I had the same kind of headache trying to install PIL by buildout, which I solved combining a lot of options and posts on the internet, together with a lot of time and trials and errors.
If anyone want to know how I finally got it working, just ask, and I will publish it.
(I consider myselve still a django starter, so I do not know for sure if anyone is interested in the solution)
PIL does not have all the options I found in cairo, so I started using cairo. On my local PC everything works fine (ubuntu desktop), on my server (Ubuntu server) I can't getting it to work......
Any other options for making drawings on the fly..... (like matplotlib...) let me know.
Pretty sure you have to give the real md5 hash to the pycairo-md5 option instead of a string with some url in it.
I would avoid specialized recipes like those two whenever possible. There are some cases when a specialized recipe really is needed, but those are cases where the dependency is so egregiously eccentric that no common build/install pattern is usable. I don't know pycairo so that may be the case.
But before assuming it is, try the following. Always try using an egg first by adding it to the eggs option of the relevant buildout part. If that doesn't work, update your question with those details, and then try adding a separate zc.recipe.egg part with build options that may help the distribution build successfully. If that doesn't work or the distribution uses a ./configure && make && make install (AKA "CMMI") build system, update your question with those details, and then try using zc.recipe.cmmi to build the package after which you can use the extra-paths option of your zc.recipe.egg part to include the relevant bits of the CMMI part (extra-paths = ${cmmi-part:location}/weird/path/to/python/modules).
This is the general dance for getting poorly/oddly behaved distributions. If this doesn't work, then a specialized recipe may be in order but in general there's a way to get it to work with the above and that will be much more maintainable.