Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: 'AircraftRequests' object has no attribute 'EnvironmentData' #115

Closed
bigsby-exe opened this issue Mar 1, 2022 · 6 comments
Closed

Comments

@bigsby-exe
Copy link

bigsby-exe commented Mar 1, 2022

Hi All,

New to MSFS but just done a fresh install and trying to connect python and getting the following error.
Any ideas on what could cause this?

DEBUG:SimConnect.SimConnect:Connected to Flight Simulator! INFO:SimConnect.SimConnect:SIM OPEN Traceback (most recent call last): File "C:/Users/Bigsby/Desktop/msfs.py", line 6, in <module> aq = AircraftRequests(sm, _time=2000) File "C:\Python310\lib\site-packages\SimConnect\RequestList.py", line 214, in __init__ self.list.append(self.EnvironmentData) AttributeError: 'AircraftRequests' object has no attribute 'EnvironmentData'

@bigsby-exe
Copy link
Author

Looks like this issue for me was caused by the latest version, using version 0.4.24 does not have this error.

@bigsby-exe
Copy link
Author

bigsby-exe commented Mar 3, 2022

For refrence the above error was achieved on Python 3.10, 3.9 & 3.6 with MSFS installed in a custom location and also after a re-install to the default location.
It was only fixed when using the older version installed from PyPi

The code to cause the error was as follows:

import logging
from SimConnect import *

logging.basicConfig()
logging.getLogger().setLevel(logging.DEBUG)

sm = SimConnect()
aq = AircraftRequests(sm, _time=2000)

@stevenjoezhang
Copy link

stevenjoezhang commented Mar 6, 2022

The bug appears to be caused by this commit 50cde9f#commitcomment-68062056

And a pull request is already opened for it: #114

@bnepethomas
Copy link

bnepethomas commented May 15, 2022

And if you are a bit of a newbie (like me) when it comes to having to grab a earlier release of the package - heres the trick:
py -m pip install SimConnect==0.4.24
Very happy to have that available :)

@bernbout
Copy link

bernbout commented Jun 9, 2022

There is an error in the file RequestList.py found in C:\Users<username>\AppData\Local\Programs\Python\Python310-32\Lib\site-packages\SimConnect.
Edit this file and go down to line 214:
self.list.append(self.EnvironmentData)
change it to
self.list.append(self.AircraftEnvironmentData)
Save and now the server will run with no error.

Note: I am using this with FSX hence the 32bit python. Also the Simconnect.dll I replaced with the one from the FSX SDK version which is 32bit.

If anyone wants to use the app (Cockpit Companion) with FSX then simply install 32bit Python, fix the environment to point to this location, replace the simconnect.dll with the 32 bit one and Bob's your uncle.

@odwdinc
Copy link
Owner

odwdinc commented Jun 15, 2022

#114 merged.

@odwdinc odwdinc closed this as completed Jun 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants