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

ImportError: No module named requests #67

Closed
crofmmv opened this issue Dec 16, 2021 · 5 comments
Closed

ImportError: No module named requests #67

crofmmv opened this issue Dec 16, 2021 · 5 comments
Labels
End User Support General help implementing the script.

Comments

@crofmmv
Copy link

crofmmv commented Dec 16, 2021

I'm getting this error when running the command python jamf2snipe --dryrun
Traceback (most recent call last):
File "jamf2snipe", line 50, in
import requests
ImportError: No module named requests

macOS Catalina 10.15.7 (19H1417)
Python 3.10

Any ideas what the issue would be? @ParadoxGuitarist

@ParadoxGuitarist ParadoxGuitarist added the End User Support General help implementing the script. label Dec 16, 2021
@ParadoxGuitarist
Copy link
Collaborator

Yeah, you need to install the requests module.
https://docs.python-requests.org/en/latest/

Probably pip install requests. The requirements are located in the requirements.txt :)

@ParadoxGuitarist
Copy link
Collaborator

https://github.com/ParadoxGuitarist/jamf2snipe#mac
You probably skipped over step 4.

@kMikaZu
Copy link

kMikaZu commented Dec 21, 2023

I use the 1Password CLI and a custom script to inject the secrets. That script is wrapped into an app, made in Platypus. It asks for the environment (Staging or Production) and should then choose the right secret.

The script runs fine, but I get a similar error.

​Staging
Installing Requirements
Requirement already satisfied: configparser in /opt/homebrew/lib/python3.11/site-packages (from -r requirements.txt (line 1)) (6.0.0)
Requirement already satisfied: requests in /opt/homebrew/lib/python3.11/site-packages (from -r requirements.txt (line 2)) (2.31.0)
Requirement already satisfied: charset-normalizer<4,>=2 in /opt/homebrew/lib/python3.11/site-packages (from requests->-r requirements.txt (line 2)) (3.3.2)
Requirement already satisfied: idna<4,>=2.5 in /opt/homebrew/lib/python3.11/site-packages (from requests->-r requirements.txt (line 2)) (3.6)
Requirement already satisfied: urllib3<3,>=1.21.1 in /opt/homebrew/lib/python3.11/site-packages (from requests->-r requirements.txt (line 2)) (2.1.0)
Requirement already satisfied: certifi>=2017.4.17 in /opt/homebrew/lib/python3.11/site-packages (from requests->-r requirements.txt (line 2)) (2023.11.17)
Running Jamf2Snipe
Traceback (most recent call last):
  File "/PATH/Jamf2Snipe.app/Contents/Resources/jamf2snipe", line 52, in <module>
    import requests
ModuleNotFoundError: No module named 'requests'
This is the end

What could be the culprit here? I followed the instructions and also created the virtualenv .

@jerm
Copy link
Member

jerm commented Dec 21, 2023

I have a suspicion that Platypus may not be using/respecting the virtualenv that you installed, but that's just a guess. I'm haven't played with Platypus, so i'm not sure how all the building/running goes together

in other words, are you sure that the virtualenv was active both for installing requirements and for running jamf2snipe?

@jerm
Copy link
Member

jerm commented Dec 21, 2023

Oh, because this is in a wildly different context --Platypus -- i think it's worth a new issue, as this is pretty far from a standard installation and not widely applicable. Please @ me in the new issue once you open it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
End User Support General help implementing the script.
Projects
None yet
Development

No branches or pull requests

4 participants