MQTT not working

When is tarted with mqtt, I installed moquitto but it never worked so I decided to create an internal broker bby adding mqtt: in the config. The project is about automating a relay connected to a nodemcu and home assistant via mqtt. I had a problem with the internal broker because mosquitto was already using port 1883 so I uninstalled mosquitto. Now it gives me the following error:

2017-07-22 17:36:48 ERROR (MainThread) [homeassistant.setup] Error during setup of component mqtt
Traceback (most recent call last):
File “/srv/homeassistant/lib/python3.4/site-packages/homeassistant/setup.py”, line 187, in _async_setup_component
result = yield from component.async_setup(hass, processed_config)
File “/srv/homeassistant/lib/python3.4/site-packages/homeassistant/components/mqtt/init.py”, line 367, in async_setup
will_message, birth_message, tls_version)
File “/srv/homeassistant/lib/python3.4/site-packages/homeassistant/components/mqtt/init.py”, line 443, in init
proto = mqtt.MQTTv311
AttributeError: ‘module’ object has no attribute ‘MQTTv311’
2017-07-22 17:36:54 ERROR (MainThread) [homeassistant.setup] Unable to setup dependencies of switch.mqtt. Setup failed for dependencies: mqtt
2017-07-22 17:36:54 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform switch.mqtt: Could not setup all dependencies.

This is the config:

homeassistant:
  # Name of the location where Home Assistant is running
  name: Home
  # Location required to calculate the time the sun rises and sets
  latitude: xxxxxx
  longitude:xxxxxx
  # Impacts weather/sunrise data (altitude above sea level in meters)
  elevation: 54
  # metric for Metric, imperial for Imperial
  unit_system: metric
  # Pick yours from here: http://en.wikipedia.org/wiki/List_of_tz_database_time_zones
  time_zone: xxxxxxx

# Show links to resources in log and frontend
introduction:

# Enables the frontend
frontend:

# Enables configuration UI
config:

http:
  # Uncomment this to add a password (recommended!)
  api_password: xxxxxxxx
  # Uncomment this if you are using SSL or running in Docker etc
  # base_url: example.duckdns.org:8123

# Checks for available updates
# Note: This component will send some information about your system to
# the developers to assist with development of Home Assistant.
# For more information, please see:
# https://home-assistant.io/blog/2016/10/25/explaining-the-updater/
updater:
  # Optional, allows Home Assistant developers to focus on popular components.
  # include_used_components: true

# Discover some devices automatically
discovery:

# Allows you to issue voice commands from the frontend in enabled browsers
conversation:

# Enables support for tracking state changes over time.
history:

# View all events in a logbook
logbook:

# Track the sun
sun:

# Weather Prediction
sensor:
  platform: yr

# Text to speech
tts:
  platform: google

group: !include groups.yaml
automation: !include automations.yaml


mqtt:
  
  
switch:
  - platform: mqtt
    state_topic: "ha/Bedroom Light"
    command_topic: "ha/Bedroom Light"

I’m new so I hope someone can help me with this. Thnx in advance :wink: