Having Trouble Importing Modules - import

Hello In this script I am trying to import the Module httplib2. I tried installing it and uninstalling it, I am not sure the problem is. This isn't the first time this happened with me trying to import new modules. Is it a problem with my pathways? If so how would I going about fixing it?

Related

No intellisense import suggestions for a module

vscode doesn't give any Code Action import suggestions for a specific python module I install in the python environment (it's a module I created). I can manually add the import - works. I get import suggestions for all other modules I installed . I can also follow up code into the module (after I have the import, go to definition works). It seems it's only missing as a source of import suggestions.
Is the module missing something?

What is the structure of import function in Python?

I am searching to do a little programm with 3D animations for one homework for my school.
I work in Spyder space from Anaconda(Python) .
I want to import for that the module vpython installed by pip.
The first line of the function " from visual import * " doesn't work whereas in all examples found on the web, all the programms begins by this line for calling the whole function of this module. Also, i have seen different path and files "vpython" installes on my PC in the path Anaconda3.
So, for me, python don't arrive to find the good path with "import".
Have I to uninstall and install again Python and Anaconda or this is just a problem of grammary from me on my programm and i must help the function import to find the good path, writing some new instructions?
Thanks to have read and i wish you have one idea of what is wrong in this because for the moment I'm blocked.
In Jupyter/iPython/Anaconda, the import should be
from vpython import *
In classic VPython, it's
from visual import *

Running files-NetworkX is missing

I am working with BooleanNet1.2.7 in Ubuntu and I am trying to run the file "all-initial-states.py", but I am facing problems. I have Python2.7 and I have installed all the other packages needed for such scripts. The problem is that when I run this file it shows an error message " networkx is missing", however I have networkx installed. I don't know how to solve it. Has anyone faced the same problem as me? Thanks!

Unresolved reference error when importing basic modules on Pycharm 4.0.1 and OS X Yosemite 10.10.1

After upgrading PyCharm to version 4.0.1 and OS X Yosemite to version 10.10.1, I encountered the following problem:
When trying to import basic modules, e.g: import time or import sys, PyCharm marks the import as an "Unresolved reference" (red underline) and does not recognise the module name.
When trying to figure it out, I noticed that while writing the module name the auto completion pop up is finding a match on the 'lib-dynload' folder within my virtualenv path (/Users/myname/Envs/envname/lib/python2.7/lib-dynload) rather than on the 'site-packages' folder.
There are also added to the PYTHOPATH in this order (lib-dynload before site-packages).
As a workaround I removed the lib-dynload path from the "project interpreter" setting window in PyCharm which made PyCharm recognise the basic modules again, but I am not sure what other impacts this change might have.
My Question is whether there is a way to reproduce the original behaviour PyCharm had so it would recognise the basic modules without tampering the paths of the virtualenv used as a project interpreter.
I am using a separate installation of Python (/usr/local/Cellar/python/2.7.6/bin/python) and virtualenv version 1.10.1.
I'm using pycharm 4.0.1 and virtualenv 1.11.6 and everything works fine to me, but i'm on Arch Linux not OSX.
You may try to recreate the virtualenv, and invalidate and restart the pycharm cache, then wait for pycharm to index again your virtualenv.
Don't know if this is too much of a hassle to you, maybe it is worth a try.
This is a django project tree i tried:
This is probably a bug, a recent youtrack issue seems to match your problem.

Tcl wasn't properly installed on Anacondas

I have a fairly new install of Anaconda with Python 3.3, and am using Pydev.
When I try to use tkinter with
from tkinter import Tk
master = Tk() # create a Tk root widget, which is a window
I get the following message
_tkinter.TclError: Can't find a usable init.tcl in the following directories:
C:/Anaconda/envs/p33/lib/tcl8.5 C:/Anaconda/envs/lib/tcl8.5 C:/Anaconda/lib/tcl8.5 C:/Anaconda/envs/library C:/Anaconda/library C:/Anaconda/tcl8.5.11/library C:/tcl8.5.11/library
This page (http://mail.python.org/pipermail/python-list/2011-March/599573.html) suggests that I need to change the TCL_LIBRARY environment variable. But I do not know how to do that.
How can I make tkinter work with my build?
This isn't a proper solution, but I got it to work by copying the folders
C:\Anaconda\envs\p33\tcl\tcl8.5
C:\Anaconda\envs\p33\tcl
to
C:\Anaconda\envs\p33\Lib