Not able to Install Gmplot in python Anaconda - python-2.7

I want to install gmplot on Anaconda ( I am user 64 bit Windows 10)
https://anaconda.org/mlgill/gmplot
run below command:
conda install -c mlgill gmplot=1.1.1
But I get this error message:
PackageNotFoundError: Package not found: '' Package missing in current
win-64 channels:
- gmplot 1.1.1*

Go to Python console in Anaconda .
Use
pip install gmplot

Hello Mayank Khandelwal,
As you send the link is of OSX, for windows you can use below github link.
https://github.com/vgm64/gmplot
Use setup.py to install.

#Zap, after installation, you need to import the library before you can use it. Here is a simple flow. Open an Anaconda Prompt then type following commands
pip install gmplot
once installation is finished. Then launch a python console and import the library,
import gmplot
now you can use it directly as you want. For example,
import gmplot
# Create the map plotter:
gmap = gmplot.GoogleMapPlotter(37.766956, -122.448481, 14, apikey=apikey)

Related

ImportError: 'No module named plotly.plotly' in LinuxMint17.3

Whenever I am trying to compile the following code to get a line graph shows some errors. But I don't know how to fix it. Here is my code :
import plotly.plotly as py
import plotly.graph_objs as go
# Create random data with numpy
import numpy as np
N = 500
random_x = np.linspace(0, 1, N)
random_y = np.random.randn(N)
# Create a trace
trace = go.Scatter(
x = random_x,
y = random_y
)
data = [trace]
py.iplot(data, filename='basic-line')
Shows the following error :
mks#mks-H81M-S /media/mks/KUTUBUDDIN1/test $ python datdaPlot.py
Traceback (most recent call last):
File "datdaPlot.py", line 1, in <module>
import plotly.plotly as py
ImportError: No module named plotly.plotly
mks#mks-H81M-S /media/mks/KUTUBUDDIN1/test $
How can this be fixed?
Added:
According to Spandan Brahmbhatt, I have installed pip by sudo pip install plotly. But still shows the following error:
You will need to install them first.
pip install plotly
pip install cufflinks
In my case I wanted to use in a Jupyter Notebook in Windows 10 but was getting the same error
ModuleNotFoundError Traceback (most recent call last)
in
----> 1 import plotly.express as px
ModuleNotFoundError: No module named 'plotly'
Considering you can also install Anaconda in Linux Mint and these came with Anaconda (in my case), if you decide to go with Anaconda you'll have at least two options to install plotly
Anaconda Prompt
Anaconda Navigator
Once installed, you'll be able to use it without any problem
1. Anaconda Prompt
Open Anaconda Prompt
Run the following command
conda install -c plotly plotly=4.8.1
2. Anaconda Navigator
Open Anaconda Navigator
Inside of it, go to Environment, select All in the dropdown and search for plotly.
Then select plotly from that list and click Apply.
I had the same problem. I accidentally was using a file in my working directory named ploylt.py. I removed that file form the directory and it works fine now.
First make sure that you have installed plotly
pip install plotly
(Test) Open an empty file, type
import plotly
and save it with a .py extension. Then run it. If this works, then your installation was ok. Move any other file named plotly (with any extension) in a different directory
It will hopefully work.
Based on ImportError: No module named plotly.plotly, I assume you have not installed plotly module.
You can install it using pip
$ pip install plotly
or
$ sudo pip install plotly
Use this:
conda install -c https://conda.anaconda.org/plotly plotly
Firstly, I'm new to plotly 2, and I am not sure I can make you understand since I'm a Chinese.
Anyway, you can try this, for me, it works:
import plotly
plotly.offline.init_notebook_mode(connected=True)
import plotly.offline as py
import plotly.plotly as py: this command will communicate with a Plotly Cloud or Plotly Enterprise. get_figure downloads a figure from plot.ly or Plotly Enterprise. You need to provide credentials to download figures: Getting Started with Plotly for Python
Refer:
Why Python line plot shows : Don't have an account? plot.ly
If you are using jupyter notebook in windows, then open the Anaconda Powershell Prompt(better to open in admin mode) and use the below command.
pip install plotly
pip install cufflinks
If you are using python from command prompt or which is set in the Environment variable then open the command prompt and use the same command mentioned above.
Both use different instance of python. So, if you use the above mentioned pip command in Anaconda PowerShell than it will install the libraries(plotly and cufflinks) in the python folder that comes with anaconda package but not in the python folder that you are using form the command prompt or which is set in the Environment variable.
I had the same problem. I found the solution by going through the directories.
pip install is installing in default python lib folder, all you have to do is copy the plotly folder from python lib to jupyter notebook lib folder. Since I am using windows the directories were as following :
c:\python34\lib\site-packages
c:\Anacoda3\Lib\site-packages
In case you searched around like I did until I found the link below, but looked here first, hopefully this will save you some frustration.
Delete the plotly.py file in your root folder. The one you created to test the get started code.
After you do that you'll be searching for a while again unless you delete the .pyc file (and get the ImportError: bad magic number in 'plotly': b'\x03\xf3\r\n').
https://github.com/plotly/plotly.py/issues/723
I was also having the same issue, but then it was due to different versions of python.
You might want to try the following command as well: (assuming you have python3 installed)
sudo pip3 install plotly
pip3 install plotly --upgrade
python3 <filename.py>
Please ensure that all the packages that are being used are installed for one python version only. As in my case all packages were installed for python3 but then I was trying to run my code with "python filename.py" and somehow that did not work.
Moreover, I also setup the credentials by following the link: https://plot.ly/settings/api. Register yourself using the link https://plot.ly/settings/api. Then create a file ~/.plotly/.credentials with your username and authentication key.
Hi I ran into something similar on my PC and here is what I advise you to do because it worked for me:
Open your Anaconda Prompt and run pip install plotly==4.1.1 cufflinks
Note that the 4.1.1 here is the version of plotly.
Installation:
Terminal:
- You can find more information about both plotly and cufflinks here.
Anaconda, Jupyter Notebook and Visual Studio Code:
- I believe I ran into this error because I did not install plotly on my PC so you can find more information on various ways of installing plotly here.
Like #Ananada, I had named my test file "plotly.py", i.e. the one containing the import plotly.graph_objects as go statement. So Python was trying to import the module from the script file I was running. Doh! Renamed it and problem solved.
To install plotly:
conda install -c plotly plotly
To check whether the installation was successful:
python3 -m pip show plotly
This shows the version of plotly installed in case of successful installation.
This worked for me!
Activate your environment again after installing the package if you are using a virtual environment.
Do source bin/activate if using bash. See https://docs.python.org/3/tutorial/venv.html.
Check your folder ... If this a temporary/test folder, maybe just like me you are wasting your whole day trying to understand why you cannot import .... .. ..
Maybe, just like happened to me - you have ANOTHER plotly.py file in your folder. Yes, that one.
Actually the module plotly is not pre-installed and we need it to be installed on our machines before using. It can be installed by using pip command :
pip install plotly
Also, we can install cufflinks. Cufflinks are smart plots.
pip install cufflinks
When you will get an error using anaconda navigator plotly install.
Go to the particular environment in Anaconda Navigator.
Then open terminal for the environment.
Install the packages.
On my Laptop, I had to use this code
!pip install pip plotly
Installing the "!" is key for my installation
All the best

import unicodecsv fails in jupyter

I tried to run
import unicodecsv
within jupyter by running a .ipynb file.
It failed.
Then I installed the unicodecsv file through the python install command and found it within c\python27 dir. But still the import did not happen.
How should it be installed. Does it need to be placed within the anaconda installation
Edit :
Error displayed -
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-1-9c1521d8df38> in <module>()
2 # 1 #
3 #####################################
----> 4 import unicodecsv
5 ## Read in the data from daily_engagement.csv and project_submissions.csv
6 ## and store the results in the below variables.
ImportError: No module named unicodecsv
Pip (Package Installer for Python) package manager also comes with Python3, you can try this variant without installing Conda (Windows):
python -m pip install unicodecsv
I had the same problem for the same file at Udacity.
Try changing the Kernel from Python2 to Python3 in the Kernel -> Change Kernel menu.
Hope that helps :)
You should install it (from the command prompt) using:
conda install unicodecsv
Install unicodecsv using:
sudo pip install unicodecsv
Restart/run your notebook again.
I had the same issue. Switching to Python 3 requires you to learn the new syntax and the rest of the nanodegree uses Python 2.
Make sure you are running the notebook in the same environment you are installing the the unicodecsv package in. Then:
conda install unicodecsv
should work. It did for me.

Unable to import docx in python3

I have installed both python2 and python3 in my windows machine. I wanted to use the python-docx, so I installed it using pip install . But I am unable to use it in python3. I get these results when i try to import in Python2:
]1
In Python3 :
]2
Python packages are installed in a particular Python installation. You have two Python installations and it looks like python-docx is installed in only one of them. What you need to work out is how to target the Python 3 installation for the python-docx install.
This question seems to address how to manage that.

How do I install Keras and Theano in Anaconda Python on Windows?

I am trying to work on neural networks in Python using the following Keras packages:
from keras.utils import np_utils
from keras.layers.core import Dense, Activation, Dropout
from keras.models import Sequential
from keras.layers.core import Dense, Dropout, Activation, Flatten
from keras.layers.convolutional import Convolution2D, MaxPooling2D
from keras.optimizers import SGD
But, I am getting the following error:
15 import theano
---> 16 from theano import gof
17 from theano.compat.python2x import partial
18 import theano.compile.mode
ImportError: cannot import name gof
Installing installed conda install keras. Later I tried to use pip install Theano, but it did not work. I Tried to install using pip install git, but I am getting this error: cannot find command git. So I installed Git and I set the environment variables.
So, is there any procedure to install these packages?
It is my solution for the same problem
Install TDM GCC x64.
Install Anaconda x64.
Open the Anaconda prompt
Run conda update conda
Run conda update --all
Run conda install mingw libpython
Install the latest version of Theano,
pip install git+git://github.com/Theano/Theano.git
Run pip install git+git://github.com/fchollet/keras.git
The trick is that you need to create an environment/workspace for Python. This solution should work for Python 2.7 but at the time of writing keras can run on python 3.5, especially if you have the latest anaconda installed (this took me awhile to figure out so I'll outline the steps I took to install KERAS in python 3.5):
Create environment/workspace for Python 3.5
C:\conda create --name neuralnets python=3.5
C:\activate neuralnets
Install everything (notice the neuralnets workspace in parenthesis on each line). Accept any dependencies each of those steps wants to install:
(neuralnets) C:\conda install theano
(neuralnets) C:\conda install mingw libpython
(neuralnets) C:\pip install tensorflow
(neuralnets) C:\pip install keras
Test it out:
(neuralnets) C:\python -c "from keras import backend; print(backend._BACKEND)"
Just remember, if you want to work in the workspace you always have to do:
C:\activate neuralnets
so you can launch Jupyter for example (assuming you also have Jupyter installed in this environment/workspace) as:
C:\activate neuralnets
(neuralnets) jupyter notebook
You can read more about managing and creating conda environments/workspaces
at the follwing URL: https://conda.io/docs/using/envs.html
In windows with anaconda, just go on conda prompt and use this command
conda install --channel https://conda.anaconda.org/conda-forge keras
I use macOS and used to have the same problem.
Running the following command in the terminal saved me:
conda install -c conda-forge keras tensorflow
Hope it helps.
In case you want to train CNN's with the theano backend like the Keras mnist_cnn.py example:
You better use theano bleeding edge version. Otherwise there may occur assertion errors.
Run Theano bleeding edge
pip install --upgrade --no-deps git+git://github.com/Theano/Theano.git
Run Keras (like 1.0.8 works fine)
pip install git+git://github.com/fchollet/keras.git
install by this command given below
conda install -c conda-forge keras
this is error "CondaError: Cannot link a source that does not exist" ive get in win 10.
for your error put this command in your command line.
conda update conda
this work for me .
In windows environment with Anconda. Go to anconda prompt from start. Then if you are behind proxy then .copndarc file needs to eb updated with the proxy details.
ssl_verify: false
channels:
- defaults
proxy_servers:
http: http://xx.xx.xx.xx:xxxx
https: https://xx.xx.xx.xx:xxxx
I had ssl_verify initially marked as 'True' then I was getting ssl error. So i turned it to false as above and then ran the below commands
conda update conda
conda update --all
conda install --channel https://conda.anaconda.org/conda-forge keras
conda install --channel https://conda.anaconda.org/conda-forge tensorflow
My python version is 3.6.7
Anaconda with Windows
Run anaconda prompt with administrator privilages
conda update conda
conda update --all
conda install mingw libpython
conda install theano
After conda commands it's required to accept process - Proceed ([y]/n)?

GraphLab Create "ImportError: No module named graphlab"

I followed these instructions to set up GraphLab on my Ubuntu machine. At the end, I opened Python 2.7.6 and ran the first of the test lines import graphlab as gl. This gave me
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named graphlab
How can I begin to diagnose this?
Details:
I ran python -V from a terminal, and it returned me Python 2.7.6.
In /usr/bin I find the following pyth* entries ... I wonder if something somewhere pointed at the wrong version:
python python2.7-config python3.4 python-config
python2 python2-config python3.4m pythontex
python2.7 python3 python3m pythontex3
The Dato Graphlab Create installer did not actually install graphlab on my Mac (El Capitan). I did the following (Anaconda is installed) in a terminal window:
% pip install graphlab-create
That subsequently installed Graphlab Create. You can then easily verify:
% python
Python 2.7.10 |Continuum Analytics, Inc.| (default, Sep 15 2015, 14:29:08)
[GCC 4.2.1 (Apple Inc. build 5577)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
Anaconda is brought to you by Continuum Analytics.
Please check out: http://continuum.io/thanks and https://anaconda.org
>>> import graphlab
>>>
I've noticed that occasionally, Python will forget that Graphlab Create is installed. A repeat of the above 'pip' command will cause it to remember.
python anaconda graphlab
Another option is to use virtualenvwrapper for the easy creation and application of virtual environments. For example, following this documentation, start with installation:
sudo pip install virtualenvwrapper
Open your .bashrc settings file, for example run gedit .bashrc and append the following lines to the bottom of it:
export WORKON_HOME=$HOME/.virtualenvs
export PROJECT_HOME=$HOME/Devel
source /usr/local/bin/virtualenvwrapper.sh
Restart your terminal window, and then you can make your virtual environment, say call it "test":
mkvirtualenv test
Now test is a virtual environment, and your are in it (i.e., test is "activated" currently). To put GraphLab in test,
pip install graphlab-create
Similarly, you can install other python toolkits in test by using pip, and any python program you run from within test will be able to see only the python toolkits that are installed here.
Maybe you should install graphlab in virtualenv.
1.Ensure your system has virtualenv installed. To verify, execute pip freeze. To install, execute sudo pip install virtualenv in your terminal before proceeding
2.Copy and execute the following commands in your terminal. This will create a virtual environment called 'graphlab' and install graphlab create version 0.9.1
virtualenv graphlab
. graphlab/bin/activate
pip install graphlab-create==0.9.1
You may need to activate the conda env by running
source activate dato-env
inside the terminal
Check your system path
import sys
print sys.path
It should contain graphlab-0.9.1. If not, then something was odd with our installation. I recommend using a virtual environment in python.
I had the same problem on ubuntu 16 desktop. The solution for me was pretty simple. After you start the notebook using
(gl-env) davis#smeagol:~/progs/ml-foundations$ jupyter notebook
Click the file navigator to locate your notebook where you do the import graphlab which causes the error. When it starts the notebook I imagine you see |Python [Root] in the top right. To fix this, click the title bar Kernel->Change kernel->gl-env. Now the top right label should say |Python [gl-env]. Afterwards when you run the notebook import graphlab will work.
There is a tab on the intial landing page of the Jupyter UI which has Conda. In that you can see two env's named root and gl-env. I've tried to delete the root one and even though its not the default all my notebooks start up with that environment and deleting it causes an internal error.
Graphlab is not supported on python3. Install Python 2.7 as mentioned in
https://conda.io/docs/user-guide/tasks/manage-python.html
If you don't see graphlab, simply the path of the environment is not set on "dato-env" (rather it may be set on "root")
If you use "Launcher" application, on top left set "Environment" to "dato-env".
Well,I guess the thread is dead.
After tinkering w/ un/reinstallations a couple times, the only way I can get "import graphlab" to work reliably is to manually activate dato-env.
Open your terminal and type below command
source activate dato-env
Prior to this close all the jupyter notebook. I ascertain that dato-env is in effect when my bash prompt changes to: (dato-env) pydev#smruti:~$
Now on your Jupyter notebook try to do import graphlab,this will execute without showing import error.
Hope this helps!!
I had the same problems, but then I found that in the files that come along with the Machine Learning specialization (https://www.coursera.org/learn/ml-foundations/notebook/lGQH5/open-your-notebook-workspace-to-follow-along) there are some additional codes after which you don't get any errors:
import graphlab
Set product key on this computer. After running this cell, you will not need to re-enter your product key.
graphlab.product_key.set_product_key('your product key here')
Limit number of worker processes. This preserves system memory, which prevents hosted notebooks from crashing.
graphlab.set_runtime_config('GRAPHLAB_DEFAULT_NUM_PYLAMBDA_WORKERS', 4)
Output active product key.
graphlab.product_key.get_product_key()
I had the same problem. I follow these steps.
1.Install Anaconda 2.7 version. Then I created vitual environment and selected python 2.7 version.
2.After create virtual environment open terminal in and run pip install notebook.
3.Then I registered https://turi.com/ because Graphlab Create requires an academic license to use.Run the following command that is given by after registration in terminal.
pip install --upgrade --no-cache-dir https://get.graphlab.com/GraphLab-Create/2.1/your registered email address here/your product key here/GraphLab-Create-License.tar.gz
4.Run jupyter notebook.
5.import graphlab
6.Then I got an error.So i run graphlab.get_dependancies() command. After that restarted the kernel.
7.After above all steps I typed import graphlab again.
8.It executed without errors.