Issue with installing causalml package python - python

I am trying to install the package causalml in Jupyter using pip, and I get the following error:
ERROR: Command errored out with exit status 1:
command: /opt/conda/bin/python3.6 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-h3qf0rqq/causalml_92ba9279cfbd4f77ac1f50f04998c187/setup.py'"'"'; __file__='"'"'/tmp/pip-install-h3qf0rqq/causalml_92ba9279cfbd4f77ac1f50f04998c187/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-m0xr_f2v
cwd: /tmp/pip-install-h3qf0rqq/causalml_92ba9279cfbd4f77ac1f50f04998c187/
Complete output (20 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-h3qf0rqq/causalml_92ba9279cfbd4f77ac1f50f04998c187/setup.py", line 56, in <module>
ext_modules=cythonize(extensions),
File "/opt/conda/lib/python3.6/site-packages/Cython/Build/Dependencies.py", line 962, in cythonize
ctx = c_options.create_context()
File "/opt/conda/lib/python3.6/site-packages/Cython/Compiler/Main.py", line 597, in create_context
self.cplus, self.language_level, options=self)
File "/opt/conda/lib/python3.6/site-packages/Cython/Compiler/Main.py", line 80, in __init__
from . import Builtin, CythonScope
File "/opt/conda/lib/python3.6/site-packages/Cython/Compiler/CythonScope.py", line 5, in <module>
from .UtilityCode import CythonUtilityCode
File "/opt/conda/lib/python3.6/site-packages/Cython/Compiler/UtilityCode.py", line 3, in <module>
from .TreeFragment import parse_from_strings, StringParseContext
File "/opt/conda/lib/python3.6/site-packages/Cython/Compiler/TreeFragment.py", line 17, in <module>
from .Visitor import VisitorTransform
File "Cython/Compiler/Visitor.py", line 17, in init Cython.Compiler.Visitor
File "/opt/conda/lib/python3.6/site-packages/Cython/Compiler/ExprNodes.py", line 46, in <module>
from .Pythran import (to_pythran, is_pythran_supported_type, is_pythran_supported_operation_type,
ImportError: cannot import name 'pythran_is_numpy_func_supported'
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
In another forum, I read that this is a cython issue, I have uninstalled and reinstalled it, and it did not work out. I am working with Python 3.6.10, and here are the versions of the dependent packages on my system.
setuptools= 50.3.0
pip=20.3
numpy=1.18.5
scipy=1.4.1
matplotlib
pandas=1.1.2
scikit-learn=0.23.2
statsmodels=0.12.0
seaborn
Cython=0.29.21
xgboost
pydotplus
tqdm
shap
dill
lightgbm
pygam
packaging
keras
tensorflow=2.3.0
I checked the dependency requirements, and I believe all the above packages are acceptable for installing causalml. I also tried cloning the git repo and installing it, and I got the same error. Your feedback and suggestion are greatly appreciated.

Related

import win32crypt: ImportError: DLL load failed: The specified module could not be found

when I run my python script, I get this error:
import win32crypt:
ImportError: DLL load failed: The specified module could not be found.
I'm on Windows 10 and I am using Python 2.7 because the project I am trying to run was made in python 2.7
I tried running the script and got this error.
I tried all the solutions in this thread too: Can't import win32crypt python module
except pip install pypiwin32: which returns this error:
Using cached pypiwin32-223.tar.gz (622 bytes)
ERROR: Command errored out with exit status 1:
command: 'C:\Python27\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'c:\\users\\matma\\appdata\\local\\temp\\pip-install-f4ecmx\\pypiwin32\\setup.py'"'"'; __file__='"'"'c:\\users\\matma\\appdata\\local\\temp\\pip-install-f4ecmx\\pypiwin32\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'c:\users\matma\appdata\local\temp\pip-pip-egg-info-tsajuh'
cwd: c:\users\matma\appdata\local\temp\pip-install-f4ecmx\pypiwin32\
Complete output (10 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Python27\lib\site-packages\setuptools\__init__.py", line 21, in <module>
import setuptools.version
File "C:\Python27\lib\site-packages\setuptools\version.py", line 1, in <module>
import pkg_resources
File "C:\Python27\lib\site-packages\pkg_resources\__init__.py", line 1380
raise SyntaxError(e) from e
^
SyntaxError: invalid syntax
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

Problems installing django-observer package

Hello I am trying to install django-observer for python3 on my Win10 PC but I keep getting following error message:
Collecting django-observer
Using cached django-observer-0.4.3.tar.gz (7.4 kB)
Requirement already satisfied: django>=1.2 in c:\users\luca dieling\appdata\local\packages\pythonsoftwarefoundation.python.3.8_qbz5n2kfra8p0\localcache\local-packages\python38\site-packages (from django-observer) (3.1.4)
Collecting distribute
Using cached distribute-0.7.3.zip (145 kB)
ERROR: Command errored out with exit status 1:
command: 'C:\Users\Luca Dieling\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Luca Dieling\\AppData\\Local\\Temp\\pip-install-k757dx1_\\distribute_c11e8be23eda49c7809d38d8e88b222e\\setup.py'"'"'; __file__='"'"'C:\\Users\\Luca Dieling\\AppData\\Local\\Temp\\pip-install-k757dx1_\\distribute_c11e8be23eda49c7809d38d8e88b222e\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\Luca Dieling\AppData\Local\Temp\pip-pip-egg-info-00os3tdp'
cwd: C:\Users\Luca Dieling\AppData\Local\Temp\pip-install-k757dx1_\distribute_c11e8be23eda49c7809d38d8e88b222e\
Complete output (15 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\Luca Dieling\AppData\Local\Temp\pip-install-k757dx1_\distribute_c11e8be23eda49c7809d38d8e88b222e\setuptools\__init__.py", line 2, in <module>
from setuptools.extension import Extension, Library
File "C:\Users\Luca Dieling\AppData\Local\Temp\pip-install-k757dx1_\distribute_c11e8be23eda49c7809d38d8e88b222e\setuptools\extension.py", line 5, in <module>
from setuptools.dist import _get_unpatched
File "C:\Users\Luca Dieling\AppData\Local\Temp\pip-install-k757dx1_\distribute_c11e8be23eda49c7809d38d8e88b222e\setuptools\dist.py", line 7, in <module>
from setuptools.command.install import install
File "C:\Users\Luca Dieling\AppData\Local\Temp\pip-install-k757dx1_\distribute_c11e8be23eda49c7809d38d8e88b222e\setuptools\command\__init__.py", line 8, in <module>
from setuptools.command import install_scripts
File "C:\Users\Luca Dieling\AppData\Local\Temp\pip-install-k757dx1_\distribute_c11e8be23eda49c7809d38d8e88b222e\setuptools\command\install_scripts.py", line 3, in <module>
from pkg_resources import Distribution, PathMetadata, ensure_directory
File "C:\Users\Luca Dieling\AppData\Local\Temp\pip-install-k757dx1_\distribute_c11e8be23eda49c7809d38d8e88b222e\pkg_resources.py", line 1518, in <module>
register_loader_type(importlib_bootstrap.SourceFileLoader, DefaultProvider)
AttributeError: module 'importlib._bootstrap' has no attribute 'SourceFileLoader'
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
I am running the command pip install django-observer
Thank you for your help
This django-observer package hasn't been maintained for a long time. The github repository states it works on Python 3 version 3.2 and 3.3 though. So you might have luck setting up a virtualenv with python 3.2 or 3.3 and working from there.
The package appears to have done work similar to that of Django Signals. You can read up on them here. Signals are an implementation of the Observer pattern.
Just FYI, I tried installing the package too and got the same error on my MacOS machine. This is why I suggest switching to Signals.

Google App Engine rtree Python Module Installation

Google App Engine, does not include libspatialindex, and hence I am unable to install rtree python module, even if it is in requirements.txt,
it gives following error, while deploying app. ( app works fine locally. ) How do I install specific lib in python standard google app engine environment ? or How do I request them to do so ?
Collecting rtree
Downloading Rtree-0.9.4.tar.gz (62 kB)
ERROR: Command errored out with exit status 1:
command: /opt/python3.8/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-hl9513g_/rtree/setup.py'"'"'; __file__='"'"'/tmp/pip-install-hl9513g_/rtree/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-0tyv4fij
cwd: /tmp/pip-install-hl9513g_/rtree/
Complete output (15 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-hl9513g_/rtree/setup.py", line 3, in <module>
import rtree
File "/tmp/pip-install-hl9513g_/rtree/rtree/__init__.py", line 1, in <module>
from .index import Rtree
File "/tmp/pip-install-hl9513g_/rtree/rtree/index.py", line 6, in <module>
from . import core
File "/tmp/pip-install-hl9513g_/rtree/rtree/core.py", line 143, in <module>
rt.Error_GetLastErrorNum.restype = ctypes.c_int
File "/opt/python3.8/lib/python3.8/ctypes/__init__.py", line 386, in __getattr__
func = self.__getitem__(name)
File "/opt/python3.8/lib/python3.8/ctypes/__init__.py", line 391, in __getitem__
func = self._FuncPtr((name_or_ordinal, self))
AttributeError: /opt/python3.8/bin/python3: undefined symbol: Error_GetLastErrorNum
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
You will need to use flexible environment with custom runtime to utilize packages not preinstalled in standard environment.
To install libspatialindex, add this to the Dockerfile:
sudo apt-get update -y
sudo apt-get install -y libspatialindex-dev

Cannot install pyOTDR

I need to install pyOTDR but some issues are preventing me to do so.
As suggested in the webpage, I tried
pip install pyOTDR
but I get
Command errored out with exit status 1
This is the whole console log:
ERROR: Command errored out with exit status 1:
command: 'c:\users\campione\appdata\local\programs\python\python38-32\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\campione\\AppData\\Local\\Temp\\pip-install-fiabozry\\lazyxml\\setup.py'"'"'; __file__='"'"'C:\\Users\\campione\\AppData\\Local\\Temp\\pip-install-fiabozry\\lazyxml\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\campione\AppData\Local\Temp\pip-pip-egg-info-_nv05fei'
cwd: C:\Users\campione\AppData\Local\Temp\pip-install-fiabozry\lazyxml\
Complete output (9 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\campione\AppData\Local\Temp\pip-install-fiabozry\lazyxml\setup.py", line 16, in <module>
import lazyxml
File "C:\Users\campione\AppData\Local\Temp\pip-install-fiabozry\lazyxml\lazyxml\__init__.py", line 15, in <module>
from . import builder
File "C:\Users\campione\AppData\Local\Temp\pip-install-fiabozry\lazyxml\lazyxml\builder.py", line 7, in <module>
import utils
ModuleNotFoundError: No module named 'utils'
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
I'm completely new to Python so bear with me, but I think it can maybe be related to "utils" module missing, as you can read at the end.
I don't understand why I could install other python packages in the same way but not this one unfortunately.
Removing Python 3 and installing Python 2 worked for some reason.

Install mysqlclient for Django database via pip

I have installed MySQL-server, python3-dev, libmysqlclient-dev. But whem I try to install mysqlclient via pip, I get some errors that I don't understand. Like this:
(Env) randomparatololer#randomparatololer:~/Documents/DJANGO/tigabelas$ pip install mysqlclient
Collecting mysqlclient
Using cached mysqlclient-1.4.6.tar.gz (85 kB)
ERROR: Command errored out with exit status 1:
command: /home/randomparatololer/Documents/DJANGO/Env/bin/python3.8 -C 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-r_ybnapl/mysqlclient/setup.py'"'"'; __file__='"'"'/tmp/pip-install-r_ybnapl/mysqlclient/setup.py'"'"';f=getattr (tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace ('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec (compile (code, __file__, '"'"'exec'"'"')' egg_info – egg-base /tmp/pip-install-r_ybnapl/mysqlclient/pip-egg-info
cwd: /tmp/pip-install-r_ybnapl/mysqlclient/
Complete output (11 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/randomparatololer/Documents/DJANGO/Env/lib/python3.8/site-packages/setuptools/__init__.py", line 20, in <module>
from setuptools.dist import Distribution, Feature
File "/home/randomparatololer/Documents/DJANGO/Env/lib/python3.8/site-packages/setuptools/dist.py", line 35, in <module>
from setuptools import windows_support
File "/home/randomparatololer/Documents/DJANGO/Env/lib/python3.8/site-packages/setuptools/windows_support.py", line 2, in <module>
import ctypes
File "/usr/local/lib/python3.8/ctypes/__init__.py", line 7, in <module>
from _ctypes import Union, Structure, Array
ModuleNotFoundError: No module named '_ctypes'
----------------------------------------
ERROR: Command errored out with exit status 1: Python setup.py egg_info Check the logs for full command output.

Categories