I installed web.py using cmd, it got successfully installed.
C:\Users\Admin1>pip install web.py==0.40.dev0
Requirement already satisfied: web.py==0.40.dev0 in c:\users\admin1\anaconda3\li
b\site-packages\web.py-0.40.dev0-py3.6.egg
But when I try to run this command on my python editor
import web
it gives error
ImportError: attempted relative import with no known parent package
Any suggestion on what m I missing??
Thanks
Domnick.
ensure you take the correct pip with the right interpreter
pip --version
and
pip3 --version
and for anaconda you have a own anaconda prompt, where you can install your packages and list, which packages are installed
On anaconda prompt:
conda list
to show your installed anaconda packages.
open the anaconda prompt:
type in:
conda install -c conda-forge web.py
I take the PyCharm IDE:
Under "file" -> "settings" -> Project Interpreter -> select Anaconda Interpreter -> in my case it´s Python3.6.1 (C:\Anaconda3\python.exe)
interpreter located in
C:\Anaconda3\python.exe
after this settings the import statement
import web
works absolutely fine for me
Related
I am getting this error when importing gtts module. I have successfully installed gtts but its is giving :: "ModuleNotFoundError: No module named 'certifi'"
I have also installed certifi using "pip install certifi".
Okay, So this error says "certifi" Module is not found. There can be many reasons for this but for your problem it seems like where you have installed certifi and from where you are accessing it( jupyter notebook) both location are different. So if you are on windows just run powershell or command prompt and run: python
when the python shell appears do:
import sys
print(sys.executable)
Note the path, Now open up your Jupyter notebook and do the same:
import sys
print(sys.executable)
if both the paths are not same that means you have been installing the certifi library to somewhere else, Now you need to check from where the python was running inside the jupyter notebook, if it was running from a conda virtual environment then you will first have to activate it either from the cmd/powershell or from the conda prompt then you just simply install the certifi library inside that using pip.
Once you are confirmed that the path were same in both the python shell and the jupyter notebook then in the same command prompt/power shell type:
pip list | findstr "certifi"
if you see a result that means certifi is installed to the same python location from where you are using it (i.e from the jupyter notebook)
Example from my PC:
Different Python Paths
But Once I activated the conda environment which the jupyter notebook was using then:
Same Python Paths
Checking for a module ("requests" in my case) if it is installed or not
I am getting an error while installing the package
pyramid-arima
I tried the following but could not resolve the issue
conda create -n pmdissue23 --yes --quiet python=3.5 numpy scipy
scikit-learn statsmodels
activate pmdissue23
pip install pyramid-arima
Output of above commands:
Requirement already satisfied: scipy>=0.9 in
/anaconda/envs/pmdissue23/lib/python3.5/site-packages (from pyramid-
arima)
Installing collected packages: Cython, pyramid-arima
changing mode of //anaconda/envs/pmdissue23/bin/cython to 755
changing mode of //anaconda/envs/pmdissue23/bin/cygdb to 755
changing mode of //anaconda/envs/pmdissue23/bin/cythonize to 755
Successfully installed Cython-0.28.1 pyramid-arima-0.6.2
Cleaning up...
But again the package is not installed correctly and pycharm asks me to download the package. This leads me to the following questions.
I am using Pycharm on windows 10 and having issues how pycharm is configured to use python. I installed python and Anaconda on my system prior to installation of Pycharm. I selected the interpreter as Anaconda when I created the first program.
Below are my questions:
Why is pycharm creating a new virtual environment for python interpreter instead of using the original installation. ( This causes me to import all the packages for each new project I create)
Should I use Anaconda or Python interpreter. I am not sure which one is the right one. Or should I have both.
I am having problems installing packages (pycharm gives me an error that my pip is not updated). However from my command line I updated the pip to the latest version. How do I connect pycharm to the latest pip.
Last question, How can I import all the data science packages to my python installation and point pycharm to read those packages instead of writing explicit import statements.
Any help would be greatly appreciated. Thanks
I reinstalled python on my machine. Updated the pip and other packages.
I am working in a conda environment (called python36)
I have installed a package 'bctpy' while in this environment via
pip install bctpy
When I now try to import this module (while still in this environment)
import bctpy
I receive the error:
ModuleNotFoundError: No module named 'bctpy'
When I run:
conda list
from the command prompt the module is there, but when in python I run
help()
modules
The outputs of which pip and which python are below:
(python36) bash-4.1$ which pip
/home/.conda/envs/python36/bin/pip
(python36) bash-4.1$ which python
/home/.conda/envs/python36/bin/python
It is not visible. is anyone able to explain what is going wrong?
This is a problem that one can encounter every now and then:
The PIP package is derived from the PyPI name bctpy
pip install bctpy
but the import name is derived from the top level directory name: bct/, so it must be imported like
import bct
Since i could not get it after my pip install ImageHash i tried following
1. Update index in Anaconda
2. Update channel
None of them helped.
but when i went to Anaconda -> Environments tab -> Click on triangle mark next to base(root) -> Open terminal -> ran command conda install -c conda-forge imagehash
Immediately after this i was able to see the package.
I'm trying to import tensorflow in PyCharm, however I get an error that the module is not found.
I used pip install to install tensorflow.
Also when I look at the interpreter in PyCharm it says I have pip version 9.0.1 and the latest is 10.0.1. I have upgraded to 10.0.1 using the pip commands, and when I run pip --version it says I got 10.0.1.
I have tried both reinstalling pycharm and making new projects with no luck.
Go to Files -> Settings -> Project:projectname -> Project Interpreter
It's possible, that there is a different interpreter choosen for your project then the one you installed tensorflow in.
If you're running on linux you can check with "which pip" the path to your python distro in which you installed tensorflow.
This video explain it on a very simple way: https://www.youtube.com/watch?v=K9ypGzuP6xQ
Basically, TensorFlow is not by default installed on PyCharm virtual environment. You can do it by downloading in the Project Interpreter menu
try cleaning System Cache
On the main menu, choose File | Invalidate Caches/Restart.
The Invalidate Caches
Cleaning Cache
I run the following line from Spyder (Anaconda3):
from plyfile import PlyData, PlyElement
and I get the following error message:
Traceback (most recent call last):
File "<ipython-input-269-2c796028388e>", line 1, in <module>
from plyfile import PlyData, PlyElement
ImportError: No module named 'plyfile'
Next I went to the Anaconda3 Scripts subdirectory and using the Windows Commander I wrote:
conda install plyfile
I received the following error message:
PackageNotFound: Package not found: "Package missing in current win 64 channels:
-plyfile
I made a search using the Google and I found the plyfile in the following address https://pypi.python.org/pypi/plyfile, but then I do not know what to do with it.
Could you please help me?
pip install plyfile, if something isn't in the default anaconda repository but still a pypi package you can pip install and conda will still track the package within your environment.
Try this. This worked for me.
sudo su
pip install plyfile
I got plyfile to work in the Windows 10 Pro environment using Spyder 3.1.3, with a Python 2.7 environment on Anaconda as follows:
Open the plyfile.py program file in Spyder #This program is in the plyfile-05 file in the pkgs subdirectory of anaconda3.
Run the plyfile.py program in spyder3 and run "import plyfile" from the IPython console. #If you use the "from plyfile import PlyData, PlyElement" statement you will get an error : TypeError: 'NoneType' object is not callable' when you run a program that calls PlyData or PlyElement.
Remove any import statement like "from plyfile import PlyData, PlyElement" from the program you want to use plyfile in. #Otherwise you will get the TypeError above when you run your program file.
Run your .py file now and the 3D figure should be generated.
First activate the conda environment where you want to install the plyfile package
source activate environment_name
Then use pip to install the plyfile package
pip install plyfile
After that you can check whether the package has been installed in the same conda environment by using
conda list
Find out executable used by Spyder or Jupyter
import sys
sys.executable
If its not using virtual environment executable
Setup ipykernal to use the virtual environment (devconda).
python -m ipykernel install --user --name=devconda
After this
sys.executable
/opt/anaconda/envs/devconda/bin/python
And the pip imports will work in Jupyter or Spyder