# Dronekit Script Not Connecting

**URL:** <https://discuss.px4.io/t/dronekit-script-not-connecting/27637>\
**Category:** MAVLink\
**Created:** [May 25, 2022, 7:42pm UTC](https://discuss.px4.io/t/dronekit-script-not-connecting/27637 "2022-05-25T19:42:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ethan\_Bartholomew](https://discuss.px4.io/user_avatar/discuss.px4.io/ethan_bartholomew/32/10834_2.png) [@Ethan\_Bartholomew](https://discuss.px4.io/u/Ethan_Bartholomew)\
**Post date:** [May 25, 2022, 7:42pm UTC](https://discuss.px4.io/t/dronekit-script-not-connecting/27637/1 "2022-05-25T19:42:34Z")

</div>

This is the script I am running to connect to a drone with px4 autopilot with a USB cable in com4.

from dronekit import connect

vehicle = connect(‘com4’, wait\_ready=True)  
print(“connection command run”)

This is the error it continually throws:

Traceback (most recent call last):  
File “C:/Users/ethan/project/DroneKit Test.py”, line 6, in   
vehicle = connect(‘com4’, wait\_ready=True)  
File “C:\Python27\lib\site-packages\dronekit\__init_\_.py”, line 3159, in connect  
handler = MAVConnection(ip, baud=baud, source\_system=source\_system, source\_component=source\_component, use\_native=use\_native)  
File “C:\Python27\lib\site-packages\dronekit\mavlink.py”, line 130, in **init**  
self.master = mavutil.mavlink\_connection(ip, baud=baud, source\_system=source\_system, source\_component=source\_component)  
File “C:\Python27\lib\site-packages\pymavlink\mavutil.py”, line 1777, in mavlink\_connection  
force\_connected=force\_connected)  
File “C:\Python27\lib\site-packages\pymavlink\mavutil.py”, line 935, in **init**  
import serial  
ImportError: No module named serial

I would really appreciate your help with this. I have been stuck at trying to connect to my drone for over a month. Also, if you have an alternative to dronekit that could you point me in the right direction and maybe include sample code to connect to the drone? Thank you!
