AttributeError: module 'clr_loader' has no attribute 'wrappers' - python

I am trying use Beeware to package my python prjocet, but when I am trying to use "briefcase dev" command, It raise this error. I found that it need to use pythonnet and clr, and when it call "from pythonnet import load", and raised error when running this line, "_LOADER_ASSEMBLY: Optional[clr_loader.wrappers.Assembly] = None". Because clr_loader do not have wrappers, and I also can't find the discription of clr.wrapper.
What's wrong with these modules? All of them are in the newest version(clr_loader =0.1.7)

I just installed a clean venv with python 3.10 about an hour ago and ran into the exact same issue.
Upgrading pythonnet to pre-release version 3.0.0rc5 (version 3.0.0rc6 was just released 2 days ago but I did not try that) fixed this issue for my environment. I originally installed version 3.0.0rc2 which installed clr_loader 0.2.3.

Related

Error occurred when installing package ‘Cartopy’

I have installed all libraries we need on this project except ‘’ Cartopy library ‘’ in Pycharm. After some research I thought it might be due to the python version so I tried dowloading the Cartopy Library in about 5 different Python versions and again the Cartopy Library is not installed.
After some more research, I thought of changing the version of Pycharm. I dowload version of 2020 and 2021 of Pycharm. Unfortunately i still got the same error :
“Error occurred when installing package ‘Cartopy”.
enter image description here
I have encountered a similar issue with another package and the problem wasn't in the IDE but the OS which in my case was mac. I had to install an ubuntu in parallel and migrate the whole project there and it ran perfectly.
I suggest you use conda instead of pip and if the issue didn't go away check the compatibility with your OS and if this is the issue you can simply install a virtual machine.

Python OpenCV Installation - DLL error while importing cv2

I've been trying to set up OpenCV on my computer for the past 3 days and haven't able to install it.
I have tried different versions of Python and OpenCV but nothing seems to be working as I'm always getting an error:
DLL error while importing cv2: The specified module could not be found.
Can someone help me to set up python, anaconda, OpenCV on my computer as I'm now completely frustrated as I've tried almost 30 different methods but in vain.
You can download the latest OpenCV 3.2.0 for Python 3.6 on Windows 32-bit or 64-bit machine, look for file starts withopencv_python‑3.2.0‑cp36‑cp36m, from this unofficial site. Then type below command to install it:
pip install opencv_python‑3.2.0‑cp36‑cp36m‑win32.whl (32-bit version)
pip install opencv_python‑3.2.0‑cp36‑cp36m‑win_amd64.whl (64-bit version)
I think it would be easier.
Try running:
pip install opencv-contrib-python

Can't find Brew installed packages on Mac M1 in Pycharm

I'm having trouble installing packages and using them in Pycharm. I've followed various threads (I'm new to Macs and seem to have tried everything) now I'm stuck.
In this case, I want to use the package xgboost.
I have brew installed, after launching a terminal using Rosetta:
%brew install xgboost
Warning: xgboost 1.3.3 is already installed and up-to-date.
It appears installed OK here:
/opt/homebrew/Cellar/xgboost
I also have Python installed here:
/opt/homebrew/Cellar/python#3.9
But no matter how I configure an Interpreter in Pycharm, I can't seem to get the package recognised.
Where have I gone wrong?
I am very unsure exactly how, but I've got this working.
Following: https://abbasegbeyemi.me/blog/homebrew-python-apple-m1
I changed the order of elements in my path:
export PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/homebrew/bin
then a new interpreter in Pycharm using:
usr/local/Cellar/Python#3.9/3.9.2_2/bin/python3.9
Now I can install packages just using pip in pycharm and it works.
This has been 6 hours of pain - warning to anyone who isn't well versed in macs, setting up an M1 for python dev was a complete nightmare for me.
Docs: https://xgboost.readthedocs.io/en/latest/build.html
Pre-built binary wheel for Python
If you are planning to use Python, consider installing XGBoost from a pre-built binary wheel, available from Python Package Index (PyPI). You may download and install it by running
# Ensure that you are downloading one of the following:
# * xgboost-{version}-py2.py3-none-manylinux1_x86_64.whl
# * xgboost-{version}-py2.py3-none-win_amd64.whl
pip3 install xgboost

tox/conda/travis-ci raises ImportError: _PyErr_ReplaceException

I want to set up Travis-CI to run the locally working test suite of a recently open-sourced Python 2.7 library. For efficiently installing dependencies like Numpy and Scipy, I found some advice to use the Miniconda distribution. Unfortunately, my .travis.yml, which
follows the official "Using Conda with Travis CI" tutorial, after successfully installing all dependencies produces this error while initializing the tox environment:
ImportError: /home/travis/build/.../.tox/py27-nose/lib/python2.7/lib-dynload/_io.so: undefined symbol: _PyErr_ReplaceException
The mentioned symbol was recently added in Issue 23781 of the Python Bug Tracker. I suspect that the problem is caused by conflicting Python versions, and tried to use Python 2.7.9 as well as 2.7.10, with and without a test environment as produced by conda create, to no avail.
I would greatly appreciate any advice!
You can downgrade by running conda install python=2.7.9 and confirm it resolves your issue.
The conda guys have now released a fixed virtualenv package that no longer has this problem.
Fixed by downgrading my Python version from 2.7.10 to 2.7.9

Struggling to install pygtk with pip

I am trying to install pygtk using pip on Windows. Initially i get an error saying
"ERROR: Could not import dsextras module: Make sure you have installed pygobject."
So when I try installing pygobject I get an error saying
"ERROR: Could not find pkg-config: please check your PATH environment variable"
Pretty new to Python so could be making a stupid mistake but does anyone have any ideas?
Thanks
I had the same problem on my Window 7 machine, and solved it by installing the prebuilt PyGTK executables, which I found here: http://ftp.gnome.org/pub/GNOME/binaries/win32/pygtk/2.22/.
I installed the "pygtk-all-in-one-...." for my version of Python (2.7).

Categories