Python 尽管安装了简单的smartsheet,脚本仍返回ModuleNotFoundError
我正在用Python3.7运行Anaconda,我想在脚本中使用simple\u smartsheet模块。我使用安装了SmartsheetPython 尽管安装了简单的smartsheet,脚本仍返回ModuleNotFoundError,python,pip,conda,smartsheet-api,Python,Pip,Conda,Smartsheet Api,我正在用Python3.7运行Anaconda,我想在脚本中使用simple\u smartsheet模块。我使用安装了Smartsheet !pip install simple-smartsheet 它显示了成功(见下文),但在运行脚本时,我得到一个ModuleNotFoundError。为什么找不到模块 以下是脚本: import logging import csv import os import sys from pprint import pprint import pandas
!pip install simple-smartsheet
它显示了成功(见下文),但在运行脚本时,我得到一个ModuleNotFoundError
。为什么找不到模块
以下是脚本:
import logging
import csv
import os
import sys
from pprint import pprint
import pandas as pd
from datetime import date
logging.basicConfig(filename='rwsheet.log', level=logging.INFO)
SheetID="Smartsheet Sheet Name"
# simple_smartsheet is a more user friendly tool to allow for everyday transactions with
# Smartsheet's API. Believe it or not, it is much better than what Smartsheet provides.
from simple_smartsheet import Smartsheet
from simple_smartsheet.models import Sheet, Column, Row, Cell, ColumnType
# Add SMARTSHEET_ACCESS_TOKEN to environment .bashrc. It holds the token assigned
# from Smartsheet to access remotely.
TOKEN = "*****************"
# Name of the Smartsheet being updated
SHEET_ID = SheetID
smartsheet = Smartsheet(TOKEN)
print("SHEET_ID: ", SHEET_ID)
sheet = smartsheet.sheets.get(SHEET_ID)
运行后,它发出的确切错误如下:
Traceback (most recent call last) <ipython-input-3-e2d38a84d6b8> in <module>
13 # simple_smartsheet is a more user freindly tool to allow for everyday transactions with
14 # Smartsheet's API. Beleive it or not, it is much better that what Smartsheet provides.
---> 15 from simple_smartsheet import Smartsheet
16 from simple_smartsheet.models import Sheet, Column, Row, Cell, ColumnType
17
ModuleNotFoundError: No module named 'simple_smartsheet'
Traceback(最近一次调用last)
13#simple#U smartsheet是一款用户更为频繁的工具,可用于与客户的日常交易
14#Smartsheet的API。信不信由你,Smartsheet提供的功能要好得多。
--->15从simple_smartsheet导入smartsheet
16从simple_smartsheet.models导入表格、列、行、单元格、列类型
17
ModuleNotFoundError:没有名为“simple\u smartsheet”的模块
这是install命令的输出:
!pip install simple-smartsheet
Requirement already satisfied: simple-smartsheet in c:\users\cabbs\anaconda3\envs\p37workshop\lib\site-packages (0.5.0)
Requirement already satisfied: attrs in c:\users\cabbs\anaconda3\envs\p37workshop\lib\site-packages (from simple-smartsheet) (19.3.0)
Requirement already satisfied: requests in c:\users\cabbs\anaconda3\envs\p37workshop\lib\site-packages (from simple-smartsheet) (2.24.0)
Requirement already satisfied: cattrs in c:\users\cabbs\anaconda3\envs\p37workshop\lib\site-packages (from simple-smartsheet) (1.0.0)
Requirement already satisfied: mypy-extensions in c:\users\cabbs\anaconda3\envs\p37workshop\lib\site-packages (from simple-smartsheet) (0.4.3)
Requirement already satisfied: aiohttp in c:\users\cabbs\anaconda3\envs\p37workshop\lib\site-packages (from simple-smartsheet) (3.7.2)
Requirement already satisfied: marshmallow<4,>=3 in c:\users\cabbs\anaconda3\envs\p37workshop\lib\site-packages (from simple-smartsheet) (3.8.0)
Requirement already satisfied: idna<3,>=2.5 in c:\users\cabbs\anaconda3\envs\p37workshop\lib\site-packages (from requests->simple-smartsheet) (2.10)
Requirement already satisfied: certifi>=2017.4.17 in c:\users\cabbs\anaconda3\envs\p37workshop\lib\site-packages (from requests->simple-smartsheet) (2020.6.20)
Requirement already satisfied: chardet<4,>=3.0.2 in c:\users\cabbs\anaconda3\envs\p37workshop\lib\site-packages (from requests->simple-smartsheet) (3.0.4)
Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in c:\users\cabbs\anaconda3\envs\p37workshop\lib\site-packages (from requests->simple-smartsheet) (1.25.9)
Requirement already satisfied: async-timeout<4.0,>=3.0 in c:\users\cabbs\anaconda3\envs\p37workshop\lib\site-packages (from aiohttp->simple-smartsheet) (3.0.1)
Requirement already satisfied: yarl<2.0,>=1.0 in c:\users\cabbs\anaconda3\envs\p37workshop\lib\site-packages (from aiohttp->simple-smartsheet) (1.6.2)
Requirement already satisfied: multidict<7.0,>=4.5 in c:\users\cabbs\anaconda3\envs\p37workshop\lib\site-packages (from aiohttp->simple-smartsheet) (5.0.0)
Requirement already satisfied: typing-extensions>=3.6.5 in c:\users\cabbs\anaconda3\envs\p37workshop\lib\site-packages (from aiohttp->simple-smartsheet) (3.7.4.2)
!pip安装简单智能表
已满足要求:c:\users\cabbs\anaconda3\envs\p37workshop\lib\site软件包(0.5.0)中的简单智能表
已满足要求:c:\users\cabbs\anaconda3\envs\p37workshop\lib\site包中的属性(来自simple smartsheet)(19.3.0)
已满足要求:c:\users\cabbs\anaconda3\envs\p37workshop\lib\site包中的请求(来自simple smartsheet)(2.24.0)
已满足要求:c:\users\cabbs\anaconda3\envs\p37workshop\lib\site包中的CATTR(来自simple smartsheet)(1.0.0)
已满足要求:c:\users\cabbs\anaconda3\envs\p37workshop\lib\site包中的mypy扩展(来自简单智能表单)(0.4.3)
已满足要求:c:\users\cabbs\anaconda3\envs\p37workshop\lib\site软件包中的aiohttp(来自简单智能表单)(3.7.2)
已满足要求:c:\users\cabbs\anaconda3\envs\p37workshop\lib\site软件包中的棉花糖=3(来自simple smartsheet)(3.8.0)
已满足要求:c:\users\cabbs\anaconda3\envs\p37workshop\lib\site软件包中的idna=2.5(来自请求->简单智能表单)(2.10)
已满足要求:c:\users\cabbs\anaconda3\envs\p37workshop\lib\site软件包中的certifi>=2017.4.17(来自请求->简单智能表单)(2020.6.20)
已满足要求:c:\users\cabbs\anaconda3\envs\p37workshop\lib\site软件包中的chardet=3.0.2(来自请求->简单智能表单)(3.0.4)
已满足要求:urllib3=1.25.0,!=c:\users\cabbs\anaconda3\envs\p37workshop\lib\site软件包中的1.25.1,=1.21.1(来自请求->简单智能表单)(1.25.9)
已满足要求:c:\users\cabbs\anaconda3\envs\p37workshop\lib\site软件包中的异步超时=3.0(来自aiohttp->simple smartsheet)(3.0.1)
已满足要求:c:\users\cabbs\anaconda3\envs\p37workshop\lib\site软件包中的yarl=1.0(来自aiohttp->simple smartsheet)(1.6.2)
已满足要求:c:\users\cabbs\anaconda3\envs\p37workshop\lib\site软件包中的multidict=4.5(来自aiohttp->simple smartsheet)(5.0.0)
已满足要求:在c:\users\cabbs\anaconda3\envs\p37workshop\lib\site软件包(来自aiohttp->simple smartsheet)中键入扩展>=3.6.5(3.7.4.2)
我最终放弃了p37workshop环境,并在Anaconda默认模式下运行。它运行没有问题!我试图运行Python 3.7版本,这就是我创建p37workshop的原因。然而,我刚刚了解到我可以使用最新的Python版本,因此我不需要继续尝试让p37workshop正常工作
谢谢你看。我越是使用simple_smartsheet,我就越是惊讶于它在多大程度上使与smartsheet的交互变得更加容易。您如何运行脚本?我们需要看到脚本实际在您所暗示的环境中执行的证据(p37workshop)。例如,考虑添加<代码>导入sys;打印(sys.prefix)以显示其运行位置。请编辑问题以包含此信息,因为这对于问题是至关重要的。导入日志导入csv导入操作系统导入系统打印(系统前缀)