[英]Cannot add 'pandas_profiling' into SQL Server using sqlmlutils
I was trying to install some module (ie pandas_profiling) in SQL Server so I can run the script directly from there.我试图在 SQL Server 中安装一些模块(即 pandas_profiling),以便我可以直接从那里运行脚本。 I was utilizing a Microsoft tool called 'sqlmlutils' to achieve this, but it returned an error specifically when I tried to install pandas_profiling (in fact another library called 'text-tools' was successfully installed. Here is the Python script to install the module to SQL Server:我正在使用名为“sqlmlutils”的 Microsoft 工具来实现此目的,但是当我尝试安装 pandas_profiling 时它返回了一个错误(实际上另一个名为“text-tools”的库已成功安装。这是安装模块的 Python 脚本到 SQL 服务器:
import sqlmlutils
connection = sqlmlutils.ConnectionInfo(server="localhost", database="SQLAI")
sqlmlutils.SQLPackageManager(connection).install("pandas-profiling")
Here is the traceback:这是回溯:
Traceback (most recent call last):
File "<ipython-input-2-e8db1d445900>", line 1, in <module>
runfile('C:/Users/BusinessUser/Desktop/abc.py', wdir='C:/Users/BusinessUser/Desktop')
File "C:\Users\BusinessUser\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 827, in runfile
execfile(filename, namespace)
File "C:\Users\BusinessUser\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 110, in execfile
exec(compile(f.read(), filename, 'exec'), namespace)
File "C:/Users/BusinessUser/Desktop/abc.py", line 3, in <module>
sqlmlutils.SQLPackageManager(connection).install("pandas_profiling")
File "C:\Users\BusinessUser\Anaconda3\lib\site-packages\sqlmlutils\packagemanagement\sqlpackagemanager.py", line 74, in install
self._install_from_pypi(package, upgrade, version, install_dependencies, scope, out_file=out_file)
File "C:\Users\BusinessUser\Anaconda3\lib\site-packages\sqlmlutils\packagemanagement\sqlpackagemanager.py", line 151, in _install_from_pypi
self._install_from_file(target_package_file, scope, upgrade, out_file=out_file)
File "C:\Users\BusinessUser\Anaconda3\lib\site-packages\sqlmlutils\packagemanagement\sqlpackagemanager.py", line 171, in _install_from_file
required_installs = resolver.get_required_installs(target_package_requirements)
File "C:\Users\BusinessUser\Anaconda3\lib\site-packages\sqlmlutils\packagemanagement\dependencyresolver.py", line 34, in get_required_installs
self._server_packages, requirement.name, spec)
File "C:\Users\BusinessUser\Anaconda3\lib\site-packages\sqlmlutils\packagemanagement\dependencyresolver.py", line 60, in _check_if_installed_package_meets_spec
return getattr(operator, operator_map[op_str])(LooseVersion(installed_version), LooseVersion(req_version))
File "C:\Users\BusinessUser\Anaconda3\lib\distutils\version.py", line 46, in __eq__
c = self._cmp(other)
File "C:\Users\BusinessUser\Anaconda3\lib\distutils\version.py", line 337, in _cmp
if self.version < other.version:
TypeError: '<' not supported between instances of 'int' and 'str'
I just want to ask if anyone has ever gotten the same error.我只是想问是否有人遇到过同样的错误。 Any help is much appreciated!任何帮助深表感谢!
me too.我也是。
My solution is to uninstall and install it again.我的解决办法是卸载重装。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.