skip to Main Content

I have install a module named "mplsoccer" in my Ubuntu to work on soccer visualization. But everytime I run, it shows: ModuleNotFoundError: No module named ‘mplsoccer’.

I ran my code on Visual Studio Code. I also tried PyCharm. In Pycharm, in the project interpreter section it shows the ‘mplsoccer’ package same as it shows ‘pandas’. But still I can’t find a solution.

2

Answers


  1. I would recommend using a package manager and virtual environment to install your packages. This ensures that all your packages are installed in one place and there are no dependency issues.

    For example, using miniconda3 and assuming it is installed already. mplsoccer is available via conda-forge which you can check by searching for packages here: https://anaconda.org/search?q=mplsoccer

    1. conda create --name <name_of_env> python=<version_#> (version_# must be > 3.6 for mplsoccer)
    2. conda activate <name_of_env>
    3. conda install -c conda-forge mplsoccer
    4. Run your python file
    Login or Signup to reply.
  2. Try the below steps:

    # Create a virtual env
    conda create -n myconda python=3.7
    conda activate myconda
    
    # install pip using conda
    conda install pip
    
    # install mplsoccer using pip
    pip install mplsoccer
    

    Then try:

    import mplsoccer
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search