error in instalation of UCI package in python
ERROR: Command "python setup.py egg_info" failed with error code 1
i already try
pip install uci4c
pip install uci
pip3 install uci
ImportError Traceback (most recent call last)
<ipython-input-5-47b8d2b39557> in <module>()
----> 1 from polyglot.downloader import downloader
c:\users\sarir\appdata\local\programs\python\python35\lib\site-packages\polyglot\downloader.py in <module>()
89
90 from polyglot import polyglot_path
---> 91 from polyglot.detect.langids import isoLangs
92 from polyglot.utils import pretty_list
93 from icu import Locale
c:\users\sarir\appdata\local\programs\python\python35\lib\site-packages\polyglot\detect\__init__.py in <module>()
----> 1 from .base import Detector, Language
2
3 __all__ = ['Detector', 'Language']
c:\users\sarir\appdata\local\programs\python\python35\lib\site-packages\polyglot\detect\base.py in <module>()
9
10
---> 11 from icu import Locale
12 import pycld2 as cld2
13
ImportError: No module named 'icu'
I think you are trying to install polyglot and you are having that problem, if you just want to install PyICU you don't need to install the PyCLD2.whl, but all the other instructions are the same:
To install polyglot in Windows using a Python 3.6 or Python 3.7 you will need a wheel for two dependencies:
You need to download them and then install them with pip from your local machine.
Here you will found many unofficial python builds:
https://www.lfd.uci.edu/~gohlke/pythonlibs/
install PyICU.whl
install PyCLD2.whl
(Do Ctrl+F "pyicu" and "pycld" because otherwise, it's difficult to navigate this website)
In both cases, you will need to be able to choose the right version of the build for your Windows version and your python version.
It's easy, for example for PyICU:
PyICU wraps the ICU (International Components for Unicode) library.
PyICU‑2.3.1‑cp27‑cp27m‑win32.whl
PyICU‑2.3.1‑cp27‑cp27m‑win_amd64.whl
PyICU‑2.3.1‑cp35‑cp35m‑win32.whl
PyICU‑2.3.1‑cp35‑cp35m‑win_amd64.whl
PyICU‑2.3.1‑cp36‑cp36m‑win32.whl
PyICU‑2.3.1‑cp36‑cp36m‑win_amd64.whl
PyICU‑2.3.1‑cp37‑cp37m‑win32.whl
PyICU‑2.3.1‑cp37‑cp37m‑win_amd64.whl
the 27 means Python 2.7 and the 36 Python 3.6...
If you have 64 bits python and windows then choose the amd64 otherwise the win32 version.
Once you have download them you will need to install it using pip in your python environment:
In my case:
python -m pip install C:\Users\Administrator\Downloads\pycld2-0.31-cp37-cp37m-win_amd64.whl
python -m pip install C:\Users\Administrator\Downloads\PyICU-2.3.1-cp37-cp37m-win_amd64.whl
Related
I want to use the Algorithms inside of the cdlib library for network analysis. I installed cdlib by:
pip install cdlib
However I am unable to check the version of the same library using
cdlib --version
which gives me an error, saying:
zsh: command not found: cdlib
Moreover, upon using
from cdlib import algorithms
--------------------------------------------------------------------------- ImportError Traceback (most recent call
last)
/var/folders/gm/d0bzgb6n4k95px0_1x9hqq_h0000gn/T/ipykernel_43989/3546710294.py
in
----> 1 from cdlib import algorithms
2 import networkx as nx
~/opt/anaconda3/lib/python3.9/site-packages/cdlib/algorithms/init.py
in
1 from .edge_clustering import *
----> 2 from .crisp_partition import *
3 from .overlapping_partition import *
4 from .attribute_clustering import *
5 from .bipartite_clustering import *
~/opt/anaconda3/lib/python3.9/site-packages/cdlib/algorithms/crisp_partition.py
in
52
53 try:
---> 54 import infomap as imp
55 except ModuleNotFoundError:
56 missing_packages.add("infomap")
~/opt/anaconda3/lib/python3.9/site-packages/infomap.py in
36 from . import _infomap
37 else:
---> 38 import _infomap
39
40 try:
ImportError:
dlopen(/Users/hrisod/opt/anaconda3/lib/python3.9/site-packages/_infomap.cpython-39-darwin.so,
0x0002): Library not loaded: /usr/local/opt/llvm/lib/libomp.dylib
Referenced from:
/Users/hrisod/opt/anaconda3/lib/python3.9/site-packages/_infomap.cpython-39-darwin.so
Reason: tried: '/usr/local/opt/llvm/lib/libomp.dylib' (no such file),
'/usr/local/lib/libomp.dylib' (no such file), '/usr/lib/libomp.dylib'
(no such file)
This error is found. I tried reinstalling the same library even using the ways in the documentation, all too no avail.
I am using jupyter notebook on mac for this project.
Can someone please help me find out how to properly download the library.
Reading your error more thoroughly, you'll note that it says 54 import infomap as imp 55 except ModuleNotFoundError: 56 missing_packages.add("infomap"). (Seems to relate to this. this bug report, and here. Since you are on a Mac, is this pertnent ==> here?)
I note you are using conda but trying to install cldlib with pip. This says maybe trying strictly with cdlib from conda may help. Uninstall via pip maybe first, using python -m pip uninstall cdlib, before trying conda.
If you want to try dealing with the infomap stuff first though ...
Since you are using conda, you should try using Anaconda that to install infomap. If you just care about using it in this notebook, you can try that with %conda install -c conda-forge infomap in a cell in the notebook.
When I call:
import pandas as pd
on tensorflow_macos (for M1 chip)
I get:
ImportError Traceback (most recent call last)
~/tensorflow_macos_venv/lib/python3.8/site-packages/pandas/__init__.py in <module>
28 try:
---> 29 from pandas._libs import hashtable as _hashtable, lib as _lib, tslib as _tslib
30 except ImportError as e: # pragma: no cover
~/tensorflow_macos_venv/lib/python3.8/site-packages/pandas/_libs/__init__.py in <module>
12
---> 13 from pandas._libs.interval import Interval
14 from pandas._libs.tslibs import (
ImportError: dlopen(/Users/ashkan/tensorflow_macos_venv/lib/python3.8/site-packages/pandas/_libs/interval.cpython-38-darwin.so, 2): no suitable image found. Did find:
/Users/ashkan/tensorflow_macos_venv/lib/python3.8/site-packages/pandas/_libs/interval.cpython-38-darwin.so: mach-o, but wrong architecture
/Users/ashkan/tensorflow_macos_venv/lib/python3.8/site-packages/pandas/_libs/interval.cpython-38-darwin.so: mach-o, but wrong architecture
The above exception was the direct cause of the following exception:
ImportError Traceback (most recent call last)
<ipython-input-3-94f55571b0d6> in <module>
1 import numpy as np
----> 2 import pandas as pd
3
4 import matplotlib.pyplot as plt
5
~/tensorflow_macos_venv/lib/python3.8/site-packages/pandas/__init__.py in <module>
31 # hack but overkill to use re
32 module = str(e).replace("cannot import name ", "")
---> 33 raise ImportError(
34 f"C extension: {module} not built. If you want to import "
35 "pandas from the source directory, you may need to run "
ImportError: C extension: dlopen(/Users/ashkan/tensorflow_macos_venv/lib/python3.8/site-packages/pandas/_libs/interval.cpython-38-darwin.so, 2): no suitable image found. Did find:
/Users/ashkan/tensorflow_macos_venv/lib/python3.8/site-packages/pandas/_libs/interval.cpython-38-darwin.so: mach-o, but wrong architecture
/Users/ashkan/tensorflow_macos_venv/lib/python3.8/site-packages/pandas/_libs/interval.cpython-38-darwin.so: mach-o, but wrong architecture not built. If you want to import pandas from the source directory, you may need to run 'python setup.py build_ext --force' to build the C extensions first.
I hope Xcode Command Line Tools is already installed. If not, please install it then follow the steps.
Step 1:miniforge
Install miniforge for arm64 (Apple Silicon) from miniforge GitHub. Miniforge enables installing python packages natively compiled for Apple Silicon.
Step 2: create Conda environment
Don’t forget to open a new session or to source your .zshrc after miniforge install and before going through this step.
Create an empty Conda environment, then activate it and install python 3.8. and all the needed packages. Please note numpy is unnecessary here as pandas already install it, but it will be overwritten in the last step with the version provided by Apple.
conda create --name mytf
conda activate mytf
conda install -y python==3.8.6
conda install -y pandas matplotlib scikit-learn jupyterlab
I have tested it. It will work after these steps.
As shown in the next post(https://github.com/apple/tensorflow_macos/issues/6), it seems that the solution is to install pandas from conda until they fix this problem.
To install pandas:
conda install pandas
Or installing directly from the source:
https://github.com/pandas-dev/pandas#installation-from-sources
Follow these steps -
Important With Tensorflow Installation
With miniforge installation do this -
conda install numpy scipy scikit-learn pandas matplotlib seaborn
Use Anaconda visual UI to install into the conda environment you created. You just select your environment and search for pandas.
I tried install Polyglot module to determine the language like this on Python. But it doesn't work.Are there solution?Or is it possible not to work?My error message is;
ModuleNotFoundError Traceback (most recent call last)
in
----> 1 import polyglot
ModuleNotFoundError: No module named 'polyglot'
Run the command for installation again on your terminal:
pip install polyglot
However, in my case it still didn't work unless I installed two more modules using following commands:
pip install PyICU-binary
pip install pycld2
So, install the above two modules too if just installing polyglot is not working for you.
I am trying to generate a python(.egg) file of cvxpy and import it. Used the below to generate the .egg file for https://github.com/cvxgrp/cvxpy:
python setup.py bdist_egg
While trying to import cvxpy I am getting the below error,
<>/cvxpy-1.0.8-py2.7-macosx-10.12-x86_64.egg/cvxpy/__init__.py in <module>()
16
17 __version__ = "1.0.8"
---> 18 from cvxpy.atoms import *
19 from cvxpy.constraints import NonPos, Zero, SOC, PSD
20 from cvxpy.expressions.variable import Variable
<>/cvxpy-1.0.8-py2.7-macosx-10.12-x86_64.egg/cvxpy/atoms/__init__.py in <module>()
<>/cvxpy-1.0.8-py2.7-macosx-10.12-x86_64.egg/cvxpy/atoms/geo_mean.py in <module>()
<>/cvxpy-1.0.8-py2.7-macosx-10.12-x86_64.egg/cvxpy/atoms/atom.py in <module>()
<>/cvxpy-1.0.8-py2.7-macosx-10.12-x86_64.egg/cvxpy/expressions/constants/__init__.py in <module>()
<>/cvxpy-1.0.8-py2.7-macosx-10.12-x86_64.egg/cvxpy/expressions/constants/constant.py in <module>()
ImportError: No module named fastcache
I am new to python, any pointers / refernces to fix this is really appreciated.
Have you installed ‘CVXPY’ properly and tested it using ‘nose’?
Following is an excerpt from cvxpy page https://www.cvxpy.org/install/index.html:
Install Anaconda.
Install cvxpy with conda.
conda install -c conda-forge lapack
conda install -c cvxgrp cvxpy
Test the installation with nose.
conda install nose
nosetests cvxpy
Python 3.5.1 |Anaconda 4.0.0 (x86_64)on OS X 10.11.3
>>> from sklearn import pipeline, model_selection
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: cannot import name 'model_selection'
tried to:
upgrade six, sk-learn,
sudo pip uninstall python-dateutil
sudo pip install python-dateutil==2.2
pip2 install six -U
pip install --ignore-installed six
pip install --ignore-installed ipython
even reinstall the anaconda...
Did NOT fixed.
Thanks for help
_________Updata________
I have checked that my six version is the newest one (version = "1.10.0")
import sklearn
sklearn.version
'0.17.1'
I found that there is no folder name "model_selection" in sklearn folder. But there is this folder in https://github.com/scikit-learn/scikit-learn/tree/3078d7d611329c46777d4004a1185a3626558efe/sklearn.
After install the dev version by
$ pip install git+git://github.com/scikit-learn/scikit-learn.git
Successfully installed scikit-learn-0.18.dev0
And then run a script which runs successfully in 0.17.1, it shows error:
from .pairwise_fast import _chi2_kernel_fast, _sparse_manhattan
ImportError: dlopen(/Users/Username/anaconda3/lib/python3.5/site-packages/sklearn/metrics/pairwise_fast.cpython-35m-darwin.so, 2): Library not loaded: libmkl_intel_lp64.dylib
Referenced from: /Users/Username/anaconda3/lib/python3.5/site-packages/sklearn/metrics/pairwise_fast.cpython-35m-darwin.so
Reason: image not found
What version of scikit-learn are you using? It looks like the latest, when I install for Python 3.5, is 0.17.1. Checking in the console:
import sklearn
sklearn.__version__
'0.17.1'
According to the documentation for this version that "model_selection" package doesn't exist. It does exist in the dev version. This should be why it is complaining.