E: Package 'python3-distutils' has no installation candidate - tensorflow

I am currently using the Google core dev board and using Putty to enter the code.
While performing the code, I got the error as below.
Traceback (most recent call last):
File "tools/generate_detections.py", line 7, in <module>
import tensorflow as tf
ModuleNotFoundError: No module named 'tensorflow'
So I typed sudo pip install tensorflow.
but I got another error as below.
Traceback (most recent call last):
File "/home/mendel/.local/bin/pip", line 6, in <module>
from pip._internal.cli.main import main
File "/usr/local/lib/python3.7/dist-packages/pip/_internal/cli/main.py", line 9, in <module>
from pip._internal.cli.autocompletion import autocomplete
File "/usr/local/lib/python3.7/dist-packages/pip/_internal/cli/autocompletion.py", line 10, in <module>
from pip._internal.cli.main_parser import create_main_parser
File "/usr/local/lib/python3.7/dist-packages/pip/_internal/cli/main_parser.py", line 8, in <module>
from pip._internal.cli import cmdoptions
File "/usr/local/lib/python3.7/dist-packages/pip/_internal/cli/cmdoptions.py", line 23, in <module>
from pip._internal.cli.parser import ConfigOptionParser
File "/usr/local/lib/python3.7/dist-packages/pip/_internal/cli/parser.py", line 12, in <module>
from pip._internal.configuration import Configuration, ConfigurationError
File "/usr/local/lib/python3.7/dist-packages/pip/_internal/configuration.py", line 27, in <module>
from pip._internal.utils.misc import ensure_dir, enum
File "/usr/local/lib/python3.7/dist-packages/pip/_internal/utils/misc.py", line 42, in <module>
from pip._internal.locations import get_major_minor_version, site_packages, user_site
File "/usr/local/lib/python3.7/dist-packages/pip/_internal/locations/__init__.py", line 14, in <module>
from . import _distutils, _sysconfig
File "/usr/local/lib/python3.7/dist-packages/pip/_internal/locations/_distutils.py", line 9, in <module>
from distutils.cmd import Command as DistutilsCommand
ModuleNotFoundError: No module named 'distutils.cmd'
So I typed sudo apt install python3-distutils.
but I got another error as below.
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package python3-distutils is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
libpython3.7-stdlib
E: Package 'python3-distutils' has no installation candidate
I can no longer find a solution.
Is there anyone who can help me?

sudo apt install python3-distutils
Just install in your Ubuntu terminal after you can install other packages!

Related

How to install DBT CLI on GCP?

I've installed DBT CLI on GCP cloud shell using pip install dbt after that I had added the path to dbt in my .profile file too -
.profile file -
if [ -d "$HOME/.local/bin" ] ; then
PATH="$HOME/.local/bin:$HOME/.local/lib/python3.9/site-packages:$PATH"
fi
export $PATH
After the above steps, now when I test the commands like - dbt --version it gives below error -
my_name#cloudshell:~$ dbt --init
Traceback (most recent call last):
File "/home/my_name/.local/bin/dbt", line 5, in <module>
from dbt.main import main
File "/home/my_name/.local/lib/python3.9/site-packages/dbt/main.py", line 11, in <module>
import dbt.version
File "/home/my_name/.local/lib/python3.9/site-packages/dbt/version.py", line 11, in <module>
import dbt.semver
File "/home/my_name/.local/lib/python3.9/site-packages/dbt/semver.py", line 8, in <module>
import dbt.utils
File "/home/my_name/.local/lib/python3.9/site-packages/dbt/utils.py", line 9, in <module>
import jinja2
File "/home/my_name/.local/lib/python3.9/site-packages/jinja2/__init__.py", line 12, in <module>
from .environment import Environment
File "/home/my_name/.local/lib/python3.9/site-packages/jinja2/environment.py", line 25, in <module>
from .defaults import BLOCK_END_STRING
File "/home/my_name/.local/lib/python3.9/site-packages/jinja2/defaults.py", line 3, in <module>
from .filters import FILTERS as DEFAULT_FILTERS # noqa: F401
File "/home/my_name/.local/lib/python3.9/site-packages/jinja2/filters.py", line 13, in <module>
from markupsafe import soft_unicode
ImportError: cannot import name 'soft_unicode' from 'markupsafe' (/usr/local/lib/python3.9/dist-packages/markupsafe/__init__.py)
Where have I failed? Can anyone please correct me?
Try pip install dbt-[adapter] (eg dbt-bigquery) which will install the latest version of dbt, rather than the pre-1.0 version you’re getting now (which has become broken due to an issue with a dependency).

ImportError: DLL load failed while importing _ctypes: The specified module could not be found

Python python-3.9.13-amd64 works well in my windows 10 pro.
after uninstalling 3.9.13 and deleting "C:\Users\Admin\AppData\Local\Programs\Python\Python310\ directory , I have installed python-3.10.9-amd64.
It logs out with error:
Traceback (most recent call last):
File "D:\python\ccdtest1.py", line 7, in <module>
import pandas as pd
File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\pandas\__init__.py", line 22, in <module>
from pandas.compat import is_numpy_dev as _is_numpy_dev # pyright: ignore # noqa:F401
File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\pandas\compat\__init__.py", line 18, in <module>
from pandas.compat.numpy import (
File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\pandas\compat\numpy\__init__.py", line 4, in <module>
from pandas.util.version import Version
File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\pandas\util\__init__.py", line 8, in <module>
from pandas.core.util.hashing import ( # noqa:F401
File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\pandas\core\util\hashing.py", line 24, in <module>
from pandas.core.dtypes.common import (
File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\pandas\core\dtypes\common.py", line 27, in <module>
from pandas.core.dtypes.base import _registry as registry
File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\pandas\core\dtypes\base.py", line 24, in <module>
from pandas.errors import AbstractMethodError
File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\pandas\errors\__init__.py", line 6, in <module>
import ctypes
File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\ctypes\__init__.py", line 8, in <module>
from _ctypes import Union, Structure, Array
ImportError: DLL load failed while importing _ctypes: The specified module could not be found.
Attempts made:
pip uinstalled pandas and installed again.
Using regedit, I added C:\Users\Admin\AppData\Local\Programs\Python\Python310\DLLs\ to path.
I copied libcrypto-1_1.dll,libssl-1_1.dll,libffi-7.dll from C:\Users\Admin\AppData\Local\Programs\Python\Python310\DLLs to my py program directory.
problem remains.
please help.
I found out the issue. There were some .pyd files in my py programs directory. I removed all .pyd, from my py programs directory.
I have installed python 3.11.1 and everything working well now.

odoo app wont launch due to circular import (cannot import name 'SUPERUSER_ID')

I've been trying to get odoo 15 to work for a bit while and after installing all dependencies and trying to run the app I've come into this error.
Traceback (most recent call last):
File "C:\odoo-15-test\server\odoo-bin", line 4, in <module>
import odoo
File "C:\odoo-15-test\server\odoo\__init__.py", line 11, in <module>
from . import http
File "C:\odoo-15-test\server\odoo\http.py", line 50, in <module>
from .service.server import memory_info
File "C:\odoo-15-test\server\odoo\service\__init__.py", line 4, in <module>
from . import common
File "C:\odoo-15-test\server\odoo\service\common.py", line 6, in <module>
import odoo.tools
File "C:\odoo-15-test\server\odoo\tools\__init__.py", line 21, in <module>
from .convert import *
File "C:\odoo-15-test\server\odoo\tools\convert.py", line 33, in <module>
from odoo import SUPERUSER_ID, api
File "C:\odoo-15-test\server\odoo\api.py", line 1022, in <module>
from odoo import SUPERUSER_ID
ImportError: cannot import name 'SUPERUSER_ID' from partially initialized module 'odoo' (most likely due to a circular import) (C:\odoo-15-test\server\odoo\__init__.py)
I have tried installing odoo with 'pip install odoo' but this didnt work and I don't see this being the problem. I have also never run into circular imports before so any help would be great thanks.

after installing odoo12 community I am getting Import error

After installing Odoo 12 Community in Ubuntu 16.04 from https://www.odoo.yenthevg.com/installing-odoo-12-enterprise-ubuntu/
I am getting following error:
Traceback (most recent call last):
File "/home/odoodev/NewOdoo12e/odoo_12.0+e.latest_all/data/usr/lib/python3/dist-packages/odoo-bin", line 5, in <module>
import odoo
File "/home/odoodev/NewOdoo12e/odoo_12.0+e.latest_all/data/usr/lib/python3/dist-packages/odoo/__init__.py", line 89, in <module>
from . import modules
File "/home/odoodev/NewOdoo12e/odoo_12.0+e.latest_all/data/usr/lib/python3/dist-packages/odoo/modules/__init__.py", line 8, in <module>
from . import db, graph, loading, migration, module, registry
File "/home/odoodev/NewOdoo12e/odoo_12.0+e.latest_all/data/usr/lib/python3/dist-packages/odoo/modules/graph.py", line 10, in <module>
import odoo.tools as tools
File "/home/odoodev/NewOdoo12e/odoo_12.0+e.latest_all/data/usr/lib/python3/dist-packages/odoo/tools/__init__.py", line 8, in <module>
from .config import config
File "/home/odoodev/NewOdoo12e/odoo_12.0+e.latest_all/data/usr/lib/python3/dist-packages/odoo/tools/config.py", line 18, in <module>
from passlib.context import CryptContext
File "/usr/local/lib/python3.5/dist-packages/passlib/context.py", line 20, in <module>
from passlib.registry import get_crypt_handler, _validate_handler_name
File "/usr/local/lib/python3.5/dist-packages/passlib/registry.py", line 11, in <module>
from passlib.utils import is_crypt_handler
File "/usr/local/lib/python3.5/dist-packages/passlib/utils/__init__.py", line 32, in <module>
from passlib.utils.compat import add_doc, b, bytes, join_bytes, join_byte_values, \
ImportError: cannot import name 'b'
I already have Odoo 12 Enterprise version, but after installing Odoo 12 Community, getting same error in Odoo 12 Enterprise.
Please try this.
sudo pip3 install passlib==1.6.5
sudo -H pip3 install --upgrade pip
sudo -H pip3 install pipenv

ModuleNotFoundError: No module named 'nets'

Hi guys I'm having an error when I'm trying to run the training using this command:
> `python train.py --logtostderr --train_dir=training/
> --pipeline_config_path=training/ssd_mobilenet_v1_coco.config`
Traceback (most recent call last): File "train.py", line 51, in
<module> from object_detection.builders import model_builder File
"C:\tensorflow1\models\research\object_detection\builders\model_builder.py",
line 35, in <module> from object_detection.models import
faster_rcnn_inception_resnet_v2_feature_extractor as frcnn_inc_res
File
"C:\tensorflow1\models\research\object_detection\models \faster_rcnn_inception_resnet_v2_feature_extractor.py",
line 28, in <module> from nets import inception_resnet_v2
ModuleNotFoundError: No module named 'nets
The nets module is in slim folder, you need to add the slim library to PYTHONPATH:
# From tensorflow/models/research/
export PYTHONPATH=$PYTHONPATH:`pwd`:`pwd`/slim
Try Installing pip install nets and also check the site package and environment package for installed folders (It worked for me)