I am trying to ensure that a library is installed in a blender instance.
I found out about ensurepip and am attempting to use it to install pip. Then I can install the external library.
However ensurepip.bootstrap() gives me the following error:
ensurepip.bootstrap()
Traceback (most recent call last):
File "<blender_console>", line 1, in <module>
File "C:\Program Files\Blender Foundation\Blender\2.74\python\lib\ensurepip\__init__.py", line 116, in bootstrap
_run_pip(args + [p[0] for p in _PROJECTS], additional_paths)
File "C:\Program Files\Blender Foundation\Blender\2.74\python\lib\ensurepip\__init__.py", line 40, in _run_pip
import pip
File "C:\Users\Ethan\AppData\Local\Temp\tmpqn93iwq6\pip-1.5.6-py2.py3-none-any.whl\pip\__init__.py", line 9, in <module>
File "C:\Users\Ethan\AppData\Local\Temp\tmpqn93iwq6\pip-1.5.6-py2.py3-none-any.whl\pip\log.py", line 8, in <module>
File "C:\Users\Ethan\AppData\Local\Temp\tmpqn93iwq6\pip-1.5.6-py2.py3-none-any.whl\pip\backwardcompat\__init__.py", line 98, in <module>
ImportError: No module named 'distutils'
Related
I have recently installed the Pydicom library on my laptop. For some reason, whenever I import the module, it displays the error:
>>> from pydicom import dcmread
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\odonn\AppData\Roaming\Python\Python311\site-packages\pydicom\__init__.py", line 32, in <module>
from pydicom.dataelem import DataElement
File "C:\Users\odonn\AppData\Roaming\Python\Python311\site-packages\pydicom\dataelem.py", line 18, in <module>
from pydicom import config # don't import datetime_conversion directly
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\odonn\AppData\Roaming\Python\Python311\site-packages\pydicom\config.py", line 323, in <module>
import pydicom.overlays.numpy_handler as overlay_np # noqa
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\odonn\AppData\Roaming\Python\Python311\site-packages\pydicom\overlays\__init__.py", line 1, in <module>
from pydicom.overlays.numpy_handler import get_overlay_array
File "C:\Users\odonn\AppData\Roaming\Python\Python311\site-packages\pydicom\overlays\numpy_handler.py", line 40, in <module>
from pydicom.pixel_data_handlers import unpack_bits
File "C:\Users\odonn\AppData\Roaming\Python\Python311\site-packages\pydicom\pixel_data_handlers\__init__.py", line 2, in <module>
from pydicom.pixel_data_handlers.util import (
File "C:\Users\odonn\AppData\Roaming\Python\Python311\site-packages\pydicom\pixel_data_handlers\util.py", line 19, in <module>
from pydicom.uid import UID
File "C:\Users\odonn\AppData\Roaming\Python\Python311\site-packages\pydicom\uid.py", line 16, in <module>
from pydicom.valuerep import STR_VR_REGEXES, validate_value
File "C:\Users\odonn\AppData\Roaming\Python\Python311\site-packages\pydicom\valuerep.py", line 617, in <module>
class TM(_DateTimeBase, datetime.time):
File "C:\Users\odonn\AppData\Roaming\Python\Python311\site-packages\pydicom\valuerep.py", line 622, in TM
_RE_TIME = re.compile(
^^^^^^^^^^^
File "C:\Program Files\Python311\Lib\re\__init__.py", line 227, in compile
return _compile(pattern, flags)
^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\Python311\Lib\re\__init__.py", line 294, in _compile
p = _compiler.compile(pattern, flags)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\Python311\Lib\re\_compiler.py", line 759, in compile
return _sre.compile(
^^^^^^^^^^^^^
RuntimeError: invalid SRE code
When using pip to install Pydicom, I received a warning:
C:\Users\odonn\Documents> pip install pydicom
Defaulting to user installation because normal site-packages is not writeable
Collecting pydicom
Using cached pydicom-2.3.0-py3-none-any.whl (2.0 MB)
Installing collected packages: pydicom
WARNING: The script pydicom.exe is installed in 'C:\Users\odonn\AppData\Roaming\Python\Python311\Scripts' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed pydicom-2.3.0
I have added the directory to PATH, but still no results. I have also done a fresh install of Python 3.11.
Neither of these solutions worked.
I am running this code using Visual Studio Code version 1.73, using Python 3.11.0 64-bit.
Installed plasticityai/magnitude (https://github.com/plasticityai/magnitude#installation)
Getting the following error when trying to run:
ModuleNotFoundError: No module named 'spacy.lang.en.tag_map'
I have reinstalled spacy with newest version using pip3. Running python3.
Command I am trying to run:
python3 -m pymagnitude.converter -i /Users/rob/Desktop/videos/glove.6B/glove.6B.300d.txt -o /Users/rob/Desktop/vectors/
Full output:
Traceback (most recent call last):
File "/usr/local/Cellar/python#3.9/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/runpy.py", line 188, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File "/usr/local/Cellar/python#3.9/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/runpy.py", line 111, in _get_module_details
__import__(pkg_name)
File "/usr/local/lib/python3.9/site-packages/pymagnitude/__init__.py", line 80, in <module>
from pymagnitude.third_party.allennlp.commands.elmo import ElmoEmbedder
File "/usr/local/lib/python3.9/site-packages/pymagnitude/third_party/allennlp/commands/__init__.py", line 8, in <module>
from allennlp.commands.configure import Configure
File "/usr/local/lib/python3.9/site-packages/pymagnitude/third_party/allennlp/commands/__init__.py", line 13, in <module>
from allennlp.commands.predict import Predict
File "/usr/local/lib/python3.9/site-packages/pymagnitude/third_party/allennlp/commands/predict.py", line 54, in <module>
from allennlp.predictors.predictor import Predictor, JsonDict
File "/usr/local/lib/python3.9/site-packages/pymagnitude/third_party/allennlp/predictors/__init__.py", line 13, in <module>
from allennlp.predictors.constituency_parser import ConstituencyParserPredictor
File "/usr/local/lib/python3.9/site-packages/pymagnitude/third_party/allennlp/predictors/constituency_parser.py", line 7, in <module>
from spacy.lang.en.tag_map import TAG_MAP
ModuleNotFoundError: No module named 'spacy.lang.en.tag_map'' ```
Issue is version of Spacy installed via pip was incorrect. Uninstalled Spacy from global pip, and works fine.
How to reproduce the behaviour
On Anaconda Prompt, I created an environment : my_env
Here, I installed spacy (pip install -U spacy) and downloaded English and Japanese Model (python -m spacy download ja_core_news_sm). Loading english model gave no error.
But when I do :
import spacy
nlp = spacy.load("ja_core_news_sm")
It gave the following error :
Traceback (most recent call last):
File "C:\Users\nitin.trivedi\AppData\Local\Continuum\anaconda3\envs\my_env\lib\site-packages\spacy\lang\ja\__init__.py", line 31, in try_sudachi_import
from sudachipy import dictionary, tokenizer
File "C:\Users\nitin.trivedi\AppData\Local\Continuum\anaconda3\envs\my_env\lib\site-packages\sudachipy\__init__.py", line 15, in <module>
from . import utf8inputtextbuilder
File "C:\Users\nitin.trivedi\AppData\Local\Continuum\anaconda3\envs\my_env\lib\site-packages\sudachipy\utf8inputtextbuilder.py", line 16, in <module>
from .dictionarylib.categorytype import CategoryType
File "C:\Users\nitin.trivedi\AppData\Local\Continuum\anaconda3\envs\anno\lib\site-packages\sudachipy\dictionarylib\__init__.py", line 19, in <module>
from . import doublearraylexicon
File "C:\Users\nitin.trivedi\AppData\Local\Continuum\anaconda3\envs\my_env\lib\site-packages\sudachipy\dictionarylib\doublearraylexicon.py", line 17, in <module>
from dartsclone import DoubleArray
File "C:\Users\nitin.trivedi\AppData\Local\Continuum\anaconda3\envs\my_env\lib\site-packages\dartsclone\__init__.py", line 1, in <module>
from dartsclone._dartsclone import DoubleArray
ImportError: DLL load failed: The specified module could not be found.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\nitin.trivedi\AppData\Local\Continuum\anaconda3\envs\my_env\lib\site-packages\spacy\__init__.py", line 30, in load
return util.load_model(name, **overrides)
File "C:\Users\nitin.trivedi\AppData\Local\Continuum\anaconda3\envs\my_env\lib\site-packages\spacy\util.py", line 170, in load_model
return load_model_from_package(name, **overrides)
File "C:\Users\nitin.trivedi\AppData\Local\Continuum\anaconda3\envs\my_env\lib\site-packages\spacy\util.py", line 191, in load_model_from_package
return cls.load(**overrides)
File "C:\Users\nitin.trivedi\AppData\Local\Continuum\anaconda3\envs\my_env\lib\site-packages\ja_core_news_sm\__init__.py", line 12, in load
return load_model_from_init_py(__file__, **overrides)
File "C:\Users\nitin.trivedi\AppData\Local\Continuum\anaconda3\envs\my_env\lib\site-packages\spacy\util.py", line 239, in load_model_from_init_py
return load_model_from_path(data_path, meta, **overrides)
File "C:\Users\nitin.trivedi\AppData\Local\Continuum\anaconda3\envs\my_env\lib\site-packages\spacy\util.py", line 203, in load_model_from_path
nlp = cls(meta=meta, **overrides)
File "C:\Users\nitin.trivedi\AppData\Local\Continuum\anaconda3\envs\my_env\lib\site-packages\spacy\language.py", line 186, in __init__
make_doc = factory(self, **meta.get("tokenizer", {}))
File "C:\Users\nitin.trivedi\AppData\Local\Continuum\anaconda3\envs\my_env\lib\site-packages\spacy\lang\ja\__init__.py", line 273, in create_tokenizer
return JapaneseTokenizer(cls, nlp, config)
File "C:\Users\nitin.trivedi\AppData\Local\Continuum\anaconda3\envs\my_env\lib\site-packages\spacy\lang\ja\__init__.py", line 139, in __init__
self.tokenizer = try_sudachi_import(self.split_mode)
File "C:\Users\nitin.trivedi\AppData\Local\Continuum\anaconda3\envs\my_env\lib\site-packages\spacy\lang\ja\__init__.py", line 44, in try_sudachi_import
"Japanese support requires SudachiPy and SudachiDict-core "
ImportError: Japanese support requires SudachiPy and SudachiDict-core (https://github.com/WorksApplications/SudachiPy). Install with `pip install sudachipy sudachidict_core` or install spaCy with `pip install spacy[ja]`.
I tried installing pip install sudachipy sudachidict_core
I checked for dartsclone and verified that it is already present.
Environment
Operating System: Windows 10
Python Version Used: 3.6.10
spaCy Version Used: 2.3.2
Environment Information: Anaconda
I am testing an application and I am getting the above error "ImportError: No module named 'requests.packages.urllib3'" Below are the details.
[root#lab ~]# python /opt/test/panda_API.py
Traceback (most recent call last):
File "/opt/test/panda_API.py", line 8, in <module>
import requests
File "/usr/lib/python2.6/site-packages/requests/__init__.py", line 58, in <module>
from . import utils
File "/usr/lib/python2.6/site-packages/requests/utils.py", line 32, in <module>
from .exceptions import InvalidURL
File "/usr/lib/python2.6/site-packages/requests/exceptions.py", line 10, in <module>
from .packages.urllib3.exceptions import HTTPError as BaseHTTPError
File "/usr/lib/python2.6/site-packages/requests/packages/__init__.py", line 99, in load_module
raise ImportError("No module named '%s'" % (name,))
ImportError: No module named 'requests.packages.urllib3'
In a bid to resolve that, I try to pip install requests. Then the following error pops up.
[root#lab ~]# pip install requests
Traceback (most recent call last):
File "/usr/bin/pip", line 5, in <module>
from pkg_resources import load_entry_point
File "/usr/lib/python2.6/site-packages/pkg_resources/__init__.py", line 954, in <module>
class Environment:
File "/usr/lib/python2.6/site-packages/pkg_resources/__init__.py", line 958, in Environment
self, search_path=None, platform=get_supported_platform(),
File "/usr/lib/python2.6/site-packages/pkg_resources/__init__.py", line 188, in get_supported_platform
plat = get_build_platform()
File "/usr/lib/python2.6/site-packages/pkg_resources/__init__.py", line 388, in get_build_platform
from sysconfig import get_platform
ImportError: No module named sysconfig
I have searched for solution here on stack overflow and other platforms, the closest is the one in this page on stack overflow. (ImportError: No module named sysconfig--can't get pip working).
I have tried the steps proposed in the above link, yet the same error "ImportError: No module named sysconfig", keeps repeating.
Running "pip -V", generated the same error.
Running the recommended command to check the version of setuptools, generated the following error --------
[root#lab pkg_resources]# python2.6 -c "import setuptools; print(setuptools.__version__)"
`Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/lib/python2.6/site-packages/setuptools/__init__.py", line 14, in <module >
import setuptools.version
File "/usr/lib/python2.6/site-packages/setuptools/version.py", line 1, in <module>
import pkg_resources
File "/usr/lib/python2.6/site-packages/pkg_resources/__init__.py", line 954, in <mo dule>
class Environment:
File "/usr/lib/python2.6/site-packages/pkg_resources/__init__.py", line 958, in Env ironment
self, search_path=None, platform=get_supported_platform(),
File "/usr/lib/python2.6/site-packages/pkg_resources/__init__.py", line 188, in get _supported_platform
plat = get_build_platform()
File "/usr/lib/python2.6/site-packages/pkg_resources/__init__.py", line 388, in get _build_platform
from sysconfig import get_platform
ImportError: No module named sysconfig
I have checked /usr/lib/python2.6/site-packages, and I do not have pkg_resources.py. Instead, what I have is the directory pkg_resources.
It appears that I have a more complicated case. Please I need help please!
Notes:
OS: CentOS release 6.10 (Final), and Python Version: Python 2.6.6
firstly run this command,
pip install requests urllib3 pyOpenSSL --force --upgrade
then install pyOpenSSL version 16.2.0 and run this command
pip install pyOpenSSL==16.2.0
Update your distribution packages! Python 2.6 is dead.
Super new to coding and i'm trying to learn Python. I have used Anaconda to manage packages, etc. I typically update Anaconda/conda in cmd with commands such as conda update conda or conda update anaconda
As of late, when using these commands, it comes up with a message: "ImportError: No module named 'Requests.exceptions'" followed by "Import Error: cannot import name 'Session'" Please see below.
Traceback (most recent call last):
File "C:\Program Files\Anaconda3\lib\site-packages\conda\cli\main.py", line 171, in main
activate.main()
File "C:\Program Files\Anaconda3\lib\site-packages\conda\cli\activate.py", line 181, in main
from ..install import symlink_conda
File "C:\Program Files\Anaconda3\lib\site-packages\conda\install.py", line 37, in <module>
from .core.package_cache import rm_fetched # NOQA
File "C:\Program Files\Anaconda3\lib\site-packages\conda\core\package_cache.py", line 9, in <module>
from .path_actions import CacheUrlAction, ExtractPackageAction
File "C:\Program Files\Anaconda3\lib\site-packages\conda\core\path_actions.py", line 33, in <module>
from ..gateways.download import download
File "C:\Program Files\Anaconda3\lib\site-packages\conda\gateways\download.py", line 10, in <module>
from requests.exceptions import ConnectionError, HTTPError, InvalidSchema, SSLError
ImportError: No module named 'requests.exceptions'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Program Files\Anaconda3\Scripts\conda-script.py", line 10, in <module>
sys.exit(main())
File "C:\Program Files\Anaconda3\lib\site-packages\conda\cli\main.py", line 179, in main
return handle_exception(e)
File "C:\Program Files\Anaconda3\lib\site-packages\conda\exceptions.py", line 634, in handle_exception
print_unexpected_error_message(e)
File "C:\Program Files\Anaconda3\lib\site-packages\conda\exceptions.py", line 596, in print_unexpected_error_message
stderrlogger.info(get_main_info_str(get_info_dict()))
File "C:\Program Files\Anaconda3\lib\site-packages\conda\cli\main_info.py", line 162, in get_info_dict
from ..connection import user_agent
File "C:\Program Files\Anaconda3\lib\site-packages\conda\connection.py", line 12, in <module>
from requests import Session, __version__ as REQUESTS_VERSION
ImportError: cannot import name 'Session'
I've tried using commands like pip install requests but it says that it has already says "Requirement already satisfied and lists locations where it is installed (i am guessing).
At this point I can't even get a response back from conda commands like conda info --envs. It doesn't do anything when i type that in.
If i need to uninstall conda/anaconda i will but am i just missing a simple fix?
Thanks friends!
You should install requests with conda if you plan to use conda as your python environment.
conda install requests