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

Mechanical Soup Error #71

Closed
batyrchary42 opened this issue Jul 3, 2020 · 21 comments
Closed

Mechanical Soup Error #71

batyrchary42 opened this issue Jul 3, 2020 · 21 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@batyrchary42
Copy link

Hi guys,

I have cloned and trying to run the script. MechanicalSoup package is installed in my machine. But, I am receiving error below.

bash-3.2$ pipenv run python /Users/.../Documents/git/fb2cal/src/fb2cal.py
Traceback (most recent call last):
  File "/Users/..../Documents/git/fb2cal/src/fb2cal.py", line 25, in <module>
    import mechanicalsoup
ModuleNotFoundError: No module named 'mechanicalsoup'
@mobeigi mobeigi added the question Further information is requested label Jul 3, 2020
@mobeigi
Copy link
Owner

mobeigi commented Jul 3, 2020

Hmm looks like it might be running with python 2 instead of python 3.6+?

Try:
pipenv run python3 /Users/.../Documents/git/fb2cal/src/fb2cal.py

@mobeigi
Copy link
Owner

mobeigi commented Jul 3, 2020

Also are you sure you followed setup instructions correctly?
You have to run pipenv install first.

@batyrchary42
Copy link
Author

batyrchary42 commented Jul 3, 2020

I have installed pipenv first. followed your instructions. tried running with python3

~ ...$ pipenv install
Installing dependencies from Pipfile.lock (db4242)…
  🐍   ▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ 0/0 — 00:00:00
To activate this project's virtualenv, run pipenv shell.
Alternatively, run a command inside the virtualenv with pipenv run.
(base) MacBook-Air-2:~ ...$ pipenv shell
Launching subshell in virtual environment…
bash-3.2$  . /Users/.../.local/share/virtualenvs/...-mPLkNOWd/bin/activate
(...) bash-3.2$ pipenv run python3 /Users/.../Documents/git/fb2cal/src/fb2cal.py
Traceback (most recent call last):
  File "/Users/.../Documents/git/fb2cal/src/fb2cal.py", line 25, in <module>
    import mechanicalsoup
ModuleNotFoundError: No module named 'mechanicalsoup'

``

@mobeigi
Copy link
Owner

mobeigi commented Jul 3, 2020

You don't need to run pipenv shell, just pipenv run directly.
That might not fix it though.

@batyrchary42
Copy link
Author

Could it be because of installed folder?

(base) MacBook-Air-2:~ ...$ pip show MechanicalSoup
Name: MechanicalSoup
Version: 0.12.0
Summary: A Python library for automating interaction with websites
Home-page: https://mechanicalsoup.readthedocs.io/
Author: UNKNOWN
Author-email: UNKNOWN
License: MIT
Location: /Users/.../opt/anaconda3/lib/python3.7/site-packages
Requires: beautifulsoup4, six, requests, lxml

``

@filmgeek5000
Copy link

Hello, i've had the same exact issue. Any update?

@mobeigi
Copy link
Owner

mobeigi commented Jul 8, 2020

@filmgeek5000 Are you also on a Mac? I am not able to reproduce the problem myself.

@filmgeek5000
Copy link

Yes I am on a Mac Mini running High Sierra

@mobeigi
Copy link
Owner

mobeigi commented Jul 9, 2020

@filmgeek5000 I can't reproduce it myself on a Mac system so its a little hard to fix.

Are you using the latest version of the files?
Are you following the steps as listed in the readme?

@filmgeek5000
Copy link

yes

@mobeigi mobeigi added the help wanted Extra attention is needed label Jul 24, 2020
@mfvo
Copy link

mfvo commented Aug 7, 2020

I have the same issue :(

@mobeigi
Copy link
Owner

mobeigi commented Aug 8, 2020

@mfvo Are you able to provide any more information about your system/environment? I cannot reproduce this issue myself so its hard to fix.

@mfvo
Copy link

mfvo commented Aug 8, 2020

@mfvo Are you able to provide any more information about your system/environment? I cannot reproduce this issue myself so its hard to fix.

I have the last mac os software, I mean 10.15.6 and running Python 3.7

@krullebolle
Copy link

Hi,

I had the same issue on linux and windows, latest python3.
Was able to run the script, after manually installing the mechanicalsoup module with pip install mechanicalsoup and after that restarting the virtual environment.

Kind regards

@viktorcsimma
Copy link

Try to change the active directory to the directory of the package, that helped me (I downloaded it into a zip file and then extracted it).

@batyrchary42 batyrchary42 changed the title Mecnahical Soup Error Mechanical Soup Error Sep 3, 2020
@jamestamplin
Copy link

I also ran up against this error.

Fresh install of MacOS 10.15.7 Catalina
Fresh install of Homebrew / Python / Pip
Checked that I was running Python 3.9

I ran pipevn run python -m fb2cal and hit the ModuleNotFoundError: No module named 'mechanicalsoup' error

I was able to get around this by running

pipenv install mechanicalsoup

Which then got past that error, but ended up with not finding the ics module, fixed that by running

pipenv install ics

...and Bob's your uncle, it worked.

Thanks for this great little script!

@mobeigi
Copy link
Owner

mobeigi commented Dec 30, 2020

@jamestamplin

Did you run pipenv install first?
That should have installed mechanicalsoup and ics based on the requirements.txt file.

I have a Mac but can't reproduce this on mine.
Maybe I'm misusing pipenv or its behaving differently on macos. 🤔

@jamestamplin
Copy link

jamestamplin commented Dec 30, 2020 via email

@nufrankz
Copy link

nufrankz commented Feb 8, 2021

I also ran up against this error.

Fresh install of MacOS 10.15.7 Catalina
Fresh install of Homebrew / Python / Pip
Checked that I was running Python 3.9

I ran pipevn run python -m fb2cal and hit the ModuleNotFoundError: No module named 'mechanicalsoup' error

I was able to get around this by running

pipenv install mechanicalsoup

Which then got past that error, but ended up with not finding the ics module, fixed that by running

pipenv install ics

...and Bob's your uncle, it worked.

Thanks for this great little script!

Confirming this on MacOSX Catalina 10.15.7, Python 2.7.16, PipEnv 2020.11.15, also, be sure to deactivate temporarily two-factor authentication on Facebook.

@igauravbhatnagar
Copy link

igauravbhatnagar commented Mar 7, 2022

Same issue on windows 11

image

Even the tests fail.

@mobeigi mobeigi added bug Something isn't working and removed help wanted Extra attention is needed question Further information is requested labels Dec 25, 2023
@mobeigi mobeigi added this to the 1.3.0 milestone Dec 25, 2023
@mobeigi mobeigi self-assigned this Dec 25, 2023
mobeigi added a commit that referenced this issue Dec 25, 2023
@mobeigi
Copy link
Owner

mobeigi commented Dec 25, 2023

This issue has been fixed as part of: #116

It was a result of various imports in __init.py__:

from .transformer import *
from .facebook_user import *
from .facebook_browser import *
from .ics_writer import *

Causing an early dependency failure to occur before SetupTools initialised and was ready to import dependencies.
The refactor now solves this issue.

@mobeigi mobeigi closed this as completed Dec 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

9 participants