I have an issue to install the gcloud sdk on my mac. I have the following error when I do the ./install.sh. Source: https://cloud.google.com/sdk/docs/quickstart
Welcome to the Google Cloud SDK!
Traceback (most recent call last):
File "/Users/kevin/Downloads/google-cloud-sdk/bin/bootstrapping/install.py", line 12, in <module>
import bootstrapping
File "/Users/kevin/Downloads/google-cloud-sdk/bin/bootstrapping/bootstrapping.py", line 32, in <module>
import setup # pylint:disable=g-import-not-at-top
File "/Users/kevin/Downloads/google-cloud-sdk/bin/bootstrapping/setup.py", line 57, in <module>
from googlecloudsdk.core.util import platforms
File "/Users/kevin/Downloads/google-cloud-sdk/lib/googlecloudsdk/__init__.py", line 23, in <module>
from googlecloudsdk.core.util import importing
File "/Users/kevin/Downloads/google-cloud-sdk/lib/googlecloudsdk/core/util/importing.py", line 23, in <module>
import imp
File "/Users/kevin/.pyenv/versions/3.9.0/lib/python3.9/imp.py", line 23, in <module>
from importlib import util
File "/Users/kevin/.pyenv/versions/3.9.0/lib/python3.9/importlib/util.py", line 2, in <module>
from . import abc
File "/Users/kevin/.pyenv/versions/3.9.0/lib/python3.9/importlib/abc.py", line 17, in <module>
from typing import Protocol, runtime_checkable
File "/Users/kevin/.pyenv/versions/3.9.0/lib/python3.9/typing.py", line 26, in <module>
import re as stdlib_re # Avoid confusion with the re we export.
File "/Users/kevin/.pyenv/versions/3.9.0/lib/python3.9/re.py", line 124, in <module>
import enum
File "/Users/kevin/Downloads/google-cloud-sdk/lib/third_party/enum/__init__.py", line 26, in <module>
spec = importlib.util.find_spec('enum')
AttributeError: module 'importlib' has no attribute 'util'
And when I do gcloud init
Traceback (most recent call last):
File "/Users/kevin/Downloads/google-cloud-sdk/lib/gcloud.py", line 104, in <module>
main()
File "/Users/kevin/Downloads/google-cloud-sdk/lib/gcloud.py", line 62, in main
from googlecloudsdk.core.util import encoding
File "/Users/kevin/Downloads/google-cloud-sdk/lib/googlecloudsdk/__init__.py", line 23, in <module>
from googlecloudsdk.core.util import importing
File "/Users/kevin/Downloads/google-cloud-sdk/lib/googlecloudsdk/core/util/importing.py", line 23, in <module>
import imp
File "/Users/kevin/.pyenv/versions/3.9.0/lib/python3.9/imp.py", line 23, in <module>
from importlib import util
File "/Users/kevin/.pyenv/versions/3.9.0/lib/python3.9/importlib/util.py", line 2, in <module>
from . import abc
File "/Users/kevin/.pyenv/versions/3.9.0/lib/python3.9/importlib/abc.py", line 17, in <module>
from typing import Protocol, runtime_checkable
File "/Users/kevin/.pyenv/versions/3.9.0/lib/python3.9/typing.py", line 26, in <module>
import re as stdlib_re # Avoid confusion with the re we export.
File "/Users/kevin/.pyenv/versions/3.9.0/lib/python3.9/re.py", line 124, in <module>
import enum
File "/Users/kevin/Downloads/google-cloud-sdk/lib/third_party/enum/__init__.py", line 26, in <module>
spec = importlib.util.find_spec('enum')
AttributeError: module 'importlib' has no attribute 'util'
I think this is a Python issue. but I'm running Python3:
python -V shows
Python 3.9.0
I have installed it with homebrew.
What can be the problem?
This is a known issue across Mac, Windows and Linux: https://issuetracker.google.com/170125513.
I'd suggest to use the recommended Python versions mentioned here (3.5 to 3.8).
Also this does not affect only to Cloud SDK but others as well (for example as mentioned here).
Thanks for your answer. Indeed, it works with the version 3.8.6 of python.
I will add some infos if it can help somebody. In order to manage python version, I have used pyenv and installed the version of python I needed.
pyenv install 3.8.6
pyenv global 3.8.6
If you want a quick fix you can add this to your bash profile and restart your terminal:
export CLOUDSDK_PYTHON=python3.8
Worked for me
Related
I am trying to import pyLDAvis but it gives the error ModuleNotFoundError: No module named '_contextvars' although I installed both pyLDAvis and contextvars. The error is as follows
Traceback (most recent call last):
File "C:/Users/ebru/Documents/Arda Docs/Mydocs/ITLS/Research/Tüpraş/Python Codes/Tupras_NLPv04.py", line 249, in <module>
import pyLDAvis
File "C:\Users\ebru\PycharmProjects\Tuprasv01\venv\lib\site-packages\pyLDAvis\__init__.py", line 44, in <module>
from ._display import *
File "C:\Users\ebru\PycharmProjects\Tuprasv01\venv\lib\site-packages\pyLDAvis\_display.py", line 7, in <module>
import jinja2
File "C:\Users\ebru\PycharmProjects\Tuprasv01\venv\lib\site-packages\jinja2\__init__.py", line 82, in <module>
_patch_async()
File "C:\Users\ebru\PycharmProjects\Tuprasv01\venv\lib\site-packages\jinja2\__init__.py", line 78, in _patch_async
from jinja2.asyncsupport import patch_all
File "C:\Users\ebru\PycharmProjects\Tuprasv01\venv\lib\site-packages\jinja2\asyncsupport.py", line 13, in <module>
import asyncio
File "C:\Users\ebru\AppData\Local\Programs\Python\Python37-32\lib\asyncio\__init__.py", line 8, in <module>
from .base_events import *
File "C:\Users\ebru\AppData\Local\Programs\Python\Python37-32\lib\asyncio\base_events.py", line 39, in <module>
from . import events
File "C:\Users\ebru\AppData\Local\Programs\Python\Python37-32\lib\asyncio\events.py", line 14, in <module>
import contextvars
File "C:\Users\ebru\AppData\Local\Programs\Python\Python37-32\lib\contextvars.py", line 1, in <module>
from _contextvars import Context, ContextVar, Token, copy_context
ModuleNotFoundError: No module named '_contextvars'
I tried to delete the underscore in contextvars.py but it did not work.
Plotting tools
import pyLDAvis
import pyLDAvis.sklearn
According to https://github.com/axnsan12/drf-yasg/issues/362#issuecomment-494360308, this problem might result from virtualenv not upgrading to the Python version you have installed.
Also, 3.7.4 has been released & includes changes related to Context Variables. Maybe upgrading to that helps?
I am using requests module in my python program. It worked great in the previous day. But now, when importing requests module, it is showing a weird error. It is working great in python2 version. But shows error in python3. I googled it but can't find a solution. I haven't changed anything. Why it is showing this error.
Here it is:
>>> import requests
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/paulsteven/.local/lib/python3.5/site-packages/requests/__init__.py", line 95, in <module>
from urllib3.contrib import pyopenssl
File "/home/paulsteven/.local/lib/python3.5/site-packages/urllib3/contrib/pyopenssl.py", line 46, in <module>
import OpenSSL.SSL
File "/home/paulsteven/.local/lib/python3.5/site-packages/OpenSSL/__init__.py", line 8, in <module>
from OpenSSL import rand, crypto, SSL
File "/home/paulsteven/.local/lib/python3.5/site-packages/OpenSSL/rand.py", line 11, in <module>
from OpenSSL._util import (
File "/home/paulsteven/.local/lib/python3.5/site-packages/OpenSSL/_util.py", line 3, in <module>
from cryptography.hazmat.bindings.openssl.binding import Binding
File "/home/paulsteven/.local/lib/python3.5/site-packages/cryptography/hazmat/bindings/openssl/binding.py", line 188, in <module>
_verify_package_version(cryptography.__version__)
File "/home/paulsteven/.local/lib/python3.5/site-packages/cryptography/hazmat/bindings/openssl/binding.py", line 175, in _verify_package_version
so_package_version = ffi.string(lib.CRYPTOGRAPHY_PACKAGE_VERSION)
AttributeError: cffi library '_openssl' has no function, constant or global variable named 'CRYPTOGRAPHY_PACKAGE_VERSION'
Reinstalling cryptography package will resolve this problem.
I just installed the discord.py rewrite branch, but attempting to use import discord or from discord.ext import commands simply results in a TypeError.
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.6/site-packages/discord/__init__.py", line 20, in <module>
from .client import Client, AppInfo
File "/usr/local/lib/python3.6/site-packages/discord/client.py", line 30, in <module>
from .guild import Guild
File "/usr/local/lib/python3.6/site-packages/discord/guild.py", line 39, in <module>
from .channel import *
File "/usr/local/lib/python3.6/site-packages/discord/channel.py", line 31, in <module>
from .webhook import Webhook
File "/usr/local/lib/python3.6/site-packages/discord/webhook.py", line 27, in <module>
import aiohttp
File "/usr/local/lib/python3.6/site-packages/aiohttp/__init__.py", line 6, in <module>
from .client import * # noqa
File "/usr/local/lib/python3.6/site-packages/aiohttp/client.py", line 15, in <module>
from . import connector as connector_mod
File "/usr/local/lib/python3.6/site-packages/aiohttp/connector.py", line 17, in <module>
from .client_proto import ResponseHandler
File "/usr/local/lib/python3.6/site-packages/aiohttp/client_proto.py", line 6, in <module>
from .http import HttpResponseParser, StreamWriter
File "/usr/local/lib/python3.6/site-packages/aiohttp/http.py", line 8, in <module>
from .http_parser import (HttpParser, HttpRequestParser, HttpResponseParser,
File "/usr/local/lib/python3.6/site-packages/aiohttp/http_parser.py", line 15, in <module>
from .http_writer import HttpVersion, HttpVersion10
File "/usr/local/lib/python3.6/site-packages/aiohttp/http_writer.py", line 304, in <module>
class URL(yarl.URL):
File "/usr/local/lib/python3.6/site-packages/yarl/__init__.py", line 232, in __init_subclass__
"is forbidden".format(cls))
TypeError: Inheritance a class <class 'aiohttp.http_writer.URL'> from URL is forbidden
Although the error is technically from yarl rather than from discord.py itself, the error only occurs upon trying to import the modules.
I've already tried reinstalling python as well as the discord.py rewrite branch, and if it makes any difference am running on a RPi 3 B+
Your aiohttp package might be out of date.
Try
pip install --upgrade aiohttp
I tried to install discord.py on my python 3.7 and it didn't work.
I had to install python 3.6.6 to make it work, maybe you are using python 3.7, if so you should try rolling back to python 3.6.6
Tried anaconda today , it seems fine but when I tried to launch Spyder each time I get this error: Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\Scripts\spyder-script.py", line 6, in <module>
from spyder.app.start import main
File "C:\ProgramData\Anaconda3\lib\site-packages\spyder\app\start.py", line 23, in <module>
from spyder.utils.external import lockfile
File "C:\ProgramData\Anaconda3\lib\site-packages\spyder\utils\external\lockfile.py", line 22, in <module>
import psutil
File "C:\Users\Jaker\AppData\Roaming\Python\Python36\site-packages\psutil\__init__.py", line 126, in <module>
from . import _pswindows as _psplatform
File "C:\Users\Jaker\AppData\Roaming\Python\Python36\site-packages\psutil\_pswindows.py", line 16, in <module>
from . import _psutil_windows as cext
ImportError: cannot import name '_psutil_windows'
Any help regarding this ? Also how do I get python 3.6.3 in anaconda..?
The problem is you have two Python versions installed in your system: one in C:\ProgramData\Anaconda3\ and the other in C:\Users\Jaker\AppData\Roaming\Python\Python36.
Please uninstall one of them and the problem will be solved.
I have manually tried to install odoo in my windows system using souce link https://nightly.odoo.com/8.0/nightly/src/odoo_8.0.latest.zip .Could any one help me to figure out why the following error was resulted while running odoo.
Traceback (most recent call last):
File "odoo.py", line 160, in <module>
main()
File "odoo.py", line 156, in main
import openerp
File "C:\Projects\odoo8\odoo-8.0-20160613\openerp\__init__.py", line 76, in <module>
import modules
File "C:\Projects\odoo8\odoo-8.0-20160613\openerp\modules\__init__.py", line 27, in <module>
from . import db, graph, loading, migration, module, registry
File "C:\Projects\odoo8\odoo-8.0-20160613\openerp\modules\graph.py", line 32, in <module>
import openerp.osv as osv
File "C:\Projects\odoo8\odoo-8.0-20160613\openerp\osv\__init__.py", line 22, in <module>
import osv
File "C:\Projects\odoo8\odoo-8.0-20160613\openerp\osv\osv.py", line 23, in <module>
from .orm import Model, TransientModel, AbstractModel
File "C:\Projects\odoo8\odoo-8.0-20160613\openerp\osv\orm.py", line 5, in <module>
from ..models import (
File "C:\Projects\odoo8\odoo-8.0-20160613\openerp\models.py", line 61, in <module>
from . import api
File "C:\Projects\odoo8\odoo-8.0-20160613\openerp\api.py", line 71, in <module>
from openerp.tools import frozendict, classproperty
ImportError: No module named tools
Python version : 2.7.9
Pls ensure your openerp folder has a directory named 'tools', if not try this link to download new instance
for windows: https://nightly.odoo.com/8.0/nightly/exe/
for Linux: https://nightly.odoo.com/8.0/nightly/src/