微软项目文件到熊猫数据框架。

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

我使用Python试图从一个微软的项目文件中读取pandas数据框架,并得到错误的代码,找到了这个代码 此处. 我的部分代码出现了故障,如下图所示

import win32com.client

# Generate Constants

MSP= "Microsoft Project 16.0 Object Library"
where = "./MSPRJ.py"
from win32com.client import makepy
import sys
sys.argv=['',"-o",where, MSP]
makepy.main()

import MSPRJ
g = globals()
for c in dir(MSPRJ.constants):
    g[c] = getattr(MSPRJ.constants,c)

我得到的错误是 Could not locate a type library matching 'Microsoft Project 16.0 Object Library'AttributeError: module 'MSPRJ' has no attribute 'constants' 当在jupyter笔记本上测试时,但奇怪的是在vs代码上我得到了 ModuleNotFoundError: No module named 'MSPRJ'

我已经检查了安装的库的版本,它只是得到了一个点,我已经尝试了所有的版本变化从10.0,但没有工作。我怎么才能让这个工作?

enter image description here

python pandas winapi ms-project
© www.soinside.com 2019 - 2024. All rights reserved.