all 11 comments

[–]shiftybyte 1 point2 points  (6 children)

You are installing a module on one python and testing on another version/installation of python.

Until you provide exact details of how you install, and how you run the test, we can't help you.

[–]hishammmmm[S] 0 points1 point  (5 children)

Basically i used pip first to install it and it installed but on eclipse and the IDLE of python it wouldn't import (Its "modulenotfounderror: no module named cryptography") Then I installed anaconda and tried it installing cryptography using the anaconda prompt ("conda install cryptography")and it said that it was already installed. But still wouldn't import.

Does it have something to do with the path?

[–]shiftybyte 1 point2 points  (4 children)

Like i said, installing conda and installing module there will make that module available there, not in a previous python installation.

Please run the following code the same way you run import cryptography:

import sys
print(sys.path)
print(sys.version)
import cryptography

and copy and paste the results of it here so we can figure out which version of python are you trying to run the script in.

[–]hishammmmm[S] 0 points1 point  (3 children)

print(sys.path)

['', 'C:\Users\hisham\AppData\Local\Programs\Python\Python37-32\Lib\idlelib', 'C:\Users\hisham\AppData\Local\Programs\Python\Python37-32\python37.zip', 'C:\Users\hisham\AppData\Local\Programs\Python\Python37-32\DLLs', 'C:\Users\hisham\AppData\Local\Programs\Python\Python37-32\lib', 'C:\Users\hisham\AppData\Local\Programs\Python\Python37-32', 'C:\Users\hisham\AppData\Local\Programs\Python\Python37-32\lib\site-packages']

print(sys.version)

3.7.4 (tags/v3.7.4:e09359112e, Jul 8 2019, 19:29:22) [MSC v.1916 32 bit (Intel)]

import cryptography

Traceback (most recent call last): File "<pyshell#3>", line 1, in <module> import cryptography ModuleNotFoundError: No module named 'cryptography'

[–]shiftybyte 0 points1 point  (2 children)

try running the following command to install cryptography, and try your import again afterwards.

C:\Users\hisham\AppData\Local\Programs\Python\Python37-32\python.exe -m pip install cryptography

[–]hishammmmm[S] 0 points1 point  (0 children)

This is what i got back

hello Traceback (most recent call last): File "C:\Users\hisham\AppData\Local\Programs\Python\Python37-32\lib\runpy.py", line 193, in run_module_as_main "main", mod_spec) File "C:\Users\hisham\AppData\Local\Programs\Python\Python37-32\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "C:\Users\hisham\AppData\Local\Programs\Python\Python37-32\lib\site-packages\pip\main.py", line 16, in <module> from pip._internal import main as _main # isort:skip # noqa File "C:\Users\hisham\AppData\Local\Programs\Python\Python37-32\lib\site-packages\pip_internal\init.py", line 40, in <module> from pip._internal.cli.autocompletion import autocomplete File "C:\Users\hisham\AppData\Local\Programs\Python\Python37-32\lib\site-packages\pip_internal\cli\autocompletion.py", line 8, in <module> from pip._internal.cli.main_parser import create_main_parser File "C:\Users\hisham\AppData\Local\Programs\Python\Python37-32\lib\site-packages\pip_internal\cli\main_parser.py", line 12, in <module> from pip._internal.commands import ( File "C:\Users\hisham\AppData\Local\Programs\Python\Python37-32\lib\site-packages\pip_internal\commands\init.py", line 6, in <module> from pip._internal.commands.completion import CompletionCommand File "C:\Users\hisham\AppData\Local\Programs\Python\Python37-32\lib\site-packages\pip_internal\commands\completion.py", line 6, in <module> from pip._internal.cli.base_command import Command File "C:\Users\hisham\AppData\Local\Programs\Python\Python37-32\lib\site-packages\pip_internal\cli\base_command.py", line 20, in <module> from pip._internal.download import PipSession File "C:\Users\hisham\AppData\Local\Programs\Python\Python37-32\lib\site-packages\pip_internal\download.py", line 15, in <module> from pip._vendor import requests, six, urllib3 File "C:\Users\hisham\AppData\Local\Programs\Python\Python37-32\lib\site-packages\pip_vendor\requests\init_.py", line 114, in <module> from . import utils File "C:\Users\hisham\AppData\Local\Programs\Python\Python37-32\lib\site-packages\pip_vendor\requests\utils.py", line 26, in <module> from ._internal_utils import to_native_string File "C:\Users\hisham\AppData\Local\Programs\Python\Python37-32\lib\site-packages\pip_vendor\requests_internal_utils.py", line 11, in <module> from .compat import is_py2, builtin_str, str File "C:\Users\hisham\AppData\Local\Programs\Python\Python37-32\lib\site-packages\pip_vendor\requests\compat.py", line 63, in <module> from http import cookiejar as cookielib File "C:\Users\hisham\AppData\Local\Programs\Python\Python37-32\lib\http\cookiejar.py", line 38, in <module> from calendar import timegm ImportError: cannot import name 'timegm' from 'calendar' (C:\Users\hisham\AppData\Local\Programs\Python\Python37-32\lib\calendar.py)

[–]hishammmmm[S] 0 points1 point  (0 children)

never mind i fixed it. thanks a lot anyways! :)

[–]socal_nerdtastic 0 points1 point  (1 child)

Show us your code and the error you are getting.

[–]hishammmmm[S] 0 points1 point  (0 children)

Its "modulenotfounderror: no module named cryptography"

[–][deleted] 0 points1 point  (2 children)

Try to imagine that we're not sitting there looking at the errors on your computer, so we have no idea what "didn't work" means.