Skip to content

ModuleNotFoundError: 'linkedin_scraper.exceptions' during installation #25

@Manamama

Description

@Manamama

ModuleNotFoundError: 'linkedin_scraper.exceptions' during installation

Problem Description

When attempting to run linkedin-mcp-server, a ModuleNotFoundError occurs for linkedin_scraper.exceptions, even after linkedin-scraper appears to be successfully installed via pip. This prevents linkedin-mcp-server from functioning.

Steps to Reproduce

  1. Ensure linkedin-mcp-server is installed (e.g., pip install /path/to/linkedin-mcp-server).
  2. Attempt to run the main.py script from linkedin-mcp-server:
    python3 /path/to/linkedin-mcp-server/main.py

Expected Behavior

linkedin-mcp-server should start and run without module import errors, assuming all dependencies are correctly installed.

Actual Behavior

The following error is raised:

ModuleNotFoundError: No module named 'linkedin_scraper.exceptions'

Further investigation using pip show -f linkedin-scraper reveals that exceptions.py is missing from the installed linkedin_scraper package, despite being present in the source repository.

Workaround/Resolution

The issue can be resolved by manually cloning the linkedin_scraper repository and installing it from the local path:

  1. Uninstall any existing linkedin-mcp-server and linkedin-scraper installations:
    pip uninstall -y linkedin-mcp-server
    pip uninstall -y linkedin-scraper
  2. Clone the linkedin_scraper repository:
    git clone https://github.com/stickerdaniel/linkedin_scraper.git
  3. Install linkedin-scraper from the local clone:
    pip install ./linkedin_scraper
  4. Reinstall linkedin-mcp-server from its local path:
    pip install /path/to/linkedin-mcp-server

Thanks to this workaround, the linkedin-mcp-server is now successfully running!

Environment

  • Operating System: Linux
  • Python Version: 3.10 (as inferred from cpython-310.pyc in pip show output)
  • pip Version: (latest as of July 12, 2025)
  • linkedin-mcp-server Version: 1.2.6
  • linkedin-scraper Version: 2.11.5 (as per pyproject.toml and pip show)

Additional Notes

It appears that the uv package manager, as suggested in the README.md for linkedin-mcp-server, is completely unnecessary for a successful installation and may even contribute to confusion regarding dependency resolution. It is recommended to consider removing uv from the installation instructions.

(To the tune of "Twinkle, Twinkle Little Star")

Code was broken, quite a fright,
Modules missing, day and night.
But with a plan, and careful hand,
We fixed the errors, through the land!
LinkedIn server, now you gleam,
Working smoothly, like a dream!

-- Gemini CLI on behalf of https://github.com/Manamama

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions