Answer the question
In order to leave comments, you need to log in
Why doesn't python see the module?
python doesn't see vk module, already tried many solutions and nothing helps. At the same time, modules like random work fine.
import vk
vkapi = vk.API('id_app', 'login', 'pass')
vkapi.access_token='tokken'
vkapi.wall.post(message="Hello, world")
Traceback (most recent call last):
File "test.py", line 3, in <module>
import vk
ImportError: No module named 'vk'
Answer the question
In order to leave comments, you need to log in
~/vk-test$ virtualenv env
New python executable in env/bin/python
Installing setuptools, pip...done.
~/vk-test$ . env/bin/activate
(env)~/vk-test$ pip install vk
Downloading/unpacking vk
Downloading vk-2.0.2.tar.gz
Running setup.py (path:/home/urtow/vk-test/env/build/vk/setup.py) egg_info for package vk
Downloading/unpacking requests>=2.8,<3.0 (from vk)
Downloading requests-2.10.0-py2.py3-none-any.whl (506kB): 506kB downloaded
Installing collected packages: vk, requests
Running setup.py install for vk
Successfully installed vk requests
Cleaning up...
(env)~/vk-test$ ipython
WARNING: Attempting to work in a virtualenv. If you encounter problems, please install IPython inside the virtualenv.
Python 2.7.6 (default, Jun 22 2015, 17:58:13)
...
In [1]: import vk
ipython3
WARNING: Attempting to work in a virtualenv. If you encounter problems, please install IPython inside the virtualenv.
Python 3.4.3 (default, Oct 14 2015, 20:28:29)
....
In [1]: import vk
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-1-d1455673e4d4> in <module>()
----> 1 import vk
ImportError: No module named 'vk'
~/vk-test$ virtualenv -p python3 env
Running virtualenv with interpreter /usr/bin/python3
Using base prefix '/usr'
New python executable in env/bin/python3
Also creating executable in env/bin/python
Installing setuptools, pip...done.
[email protected]:~/vk-test$ . env/bin/activate
(env)~/vk-test$ python
Python 3.4.3 (default, Oct 14 2015, 20:28:29)
[GCC 4.8.4] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
(env)~/vk-test$ pip install vk
Downloading/unpacking vk
Downloading vk-2.0.2.tar.gz
Running setup.py (path:/home/urtow/vk-test/env/build/vk/setup.py) egg_info for package vk
Downloading/unpacking requests>=2.8,<3.0 (from vk)
Downloading requests-2.10.0-py2.py3-none-any.whl (506kB): 506kB downloaded
Installing collected packages: vk, requests
Running setup.py install for vk
Successfully installed vk requests
Cleaning up...
(env)~/vk-test$ ipython3
WARNING: Attempting to work in a virtualenv. If you encounter problems, please install IPython inside the virtualenv.
Python 3.4.3 (default, Oct 14 2015, 20:28:29)
...
In [1]: import vk
In [2]:
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question