使用 conda、pip 或 setup.py 安装 pandas_csv_sniffer 失败

问题描述 投票:0回答:1

我在使用当前版本的 pandas、Python、conda 和 pip 安装 pandas_csv_sniffer Python 包时遇到困难。

(此包提供了一个有用的 jupyter 笔记本 GUI,用于查找 pandas.csv_read 函数的良好参数。)

conda 包将是最强大的,但我不知道如何将其重建和分发为标准 conda 包。我什至尝试使用 setup.py 文件,这是一种已弃用的方法。

setup.cfg 和 pyproject.toml 文件对于找出包依赖关系没有帮助。

我在 Stack Overflow 上搜索并找不到与此包相关的任何问题或答案。安装这个的最佳方法是什么?

我正在使用以下相关的软件包版本:

  • Python v3.11
  • 熊猫v2.1.2

我尝试过的: 我尝试了几种方法来安装这个包:

  1. conda install -c conda-forge pandas_csv_sniffer
    ---> 失败
    此操作失败并显示消息“package not available in conda Channels”,因此这意味着没有 condda 包。

  2. pip install pandas_csv_sniffer
    ---> 失败

(base) C:\Users\hilar>pip install pandas_csv_sniffer
ERROR: Could not find a version that satisfies the requirement pandas_csv_sniffer (from versions: none)
ERROR: No matching distribution found for pandas_csv_sniffer
  1. python setup.py install
    :setup.py安装方法似乎可以工作,但是当我尝试导入它时找不到包。
(pandas_tools2) C:\Users\hilar\Desktop\00_PythonWIP\pandas_csv_sniffer>python
Python 3.11.6 | packaged by conda-forge | (main, Oct 3 2023, 10:29:11) [MSC v.1935 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
  
import pandas_csv_sniffer
Traceback (most recent call last):
File "", line 1, in
ModuleNotFoundError: No module named 'pandas_csv_sniffer'

这是当前环境的快照,专门为尝试安装此软件包而创建(conda 和 pip install 命令失败,然后使用了“python setup.py install”)。

(pandas_tools2) C:\Users\hilar\Desktop\00_PythonWIP\pandas_csv_sniffer>pip list

DEPRECATION: Loading egg at c:\programdata\anaconda3\envs\pandas_tools2\lib\site-packages\csv_sniffer_jdfekete-0.1-py3.11.egg is deprecated. pip 24.3 will enforce this behaviour change. A possible replacement is to use pip for package installation.. Discussion can be found at pypa/pip#12330
DEPRECATION: Loading egg at c:\programdata\anaconda3\envs\pandas_tools2\lib\site-packages\fsspec-2023.10.0-py3.11.egg is deprecated. pip 24.3 will enforce this behaviour change. A possible replacement is to use pip for package installation.. Discussion can be found at pypa/pip#12330

软件包版本:我的环境中软件包的完整列表

python pandas conda jupyter-lab read-csv
1个回答
0
投票

GitHub

 上的存储库名称为 
pandas_csv_sniffer
,但 Python 模块的名称为 
csv_sniffer

查看

Jupyter

 上带有 
GitHub
 的图像 - 它显示线 
import csv_sniffer

所以在

python setup.py install

之后你应该测试
import csv_sniffer

而不是
import pandas_csv_sniffer
。这在我的电脑上有效。

© www.soinside.com 2019 - 2024. All rights reserved.