I need help getting ghost.py to be recognised by ipython notebook which i run from c/python27/scripts
I also installed pyQt4 via a binary from chris gohlke but which also isn't being recognised by my ipython installation under windows.
i downloaded zip from github extracted to a folder inside c/python27/scripts directory and installed it via command prompt
python install setup.py
but when I import ghost and try and use it my Ipython it is not recognised.
update: pyQt4 is not being recognised even though it's installed under c/python27/lib/site-pacakges, and the path is in the variable name
Related
I am on Linux Mint. When i try to import robot for robotframework in my python application it doesnt get recognized as a installed library. This while i checked the executable with the "which" command.
which python
Gives the output: /usr/bin/python
I put that path '/usr/bin/python' in the interpreter path in vscode. But it doesn't get
the installed libraries.
when i use the terminal outside of vscode and do
pip list
I get a big list with all of my installed libraries. But when i do the same in VScode i just get a short list with nothing of the installed libraries.
I tried to deinstall python, vscode and reinstall both but that doesn't work. The python path to the system python.exe is in the PATH variables. I dont know what i can try further.
It looks like that they both point to the same pip instance but it doesn't recognize the same packages. Like it cant find the site-packages folder
Can anyone please help?
I've found the problem.
In Linux Mint when you install visual studio code via the application manager built into the OS. It installs the flatpack version of Visual studio code. Which creates what looks like its own environment that cannot get the pip packages from the main system.
For me what solved it was to download the .deb version from the official vscode website(https://code.visualstudio.com/Download) and install that one using the:
sudo apt install /Downloads/{name of downloaded.deb file}
When I used this version of Visual studio code it all worked for me with no problem.
I'm currently working in VS code; wanting to interact with an .mdb file.
File "d:/UDtools/CostEstimator/vsWorkspace/pyOdbcv1.py", line 1, in <module>
import pyodbc
ModuleNotFoundError: No module named 'pyodbc'
pip installed in cmd, pip installed again in VS terminal: Requirement already satisfied.
I'm a bit new to this.
The reason is that the module "pyodbc" you installed is not installed in the VSCode environment you are currently using.
Check the installation tool "pip". When we use 'pip' to install a module, the source of 'pip' determines where the module exists. Use "pip --version" to check if it comes from the current environment:
(If not, please use the shortcut key Ctrl+Shift+` to open a new VSCode terminal, VSCode will automatically enter the current environment.)
Install the module. Use 'pip' to install the module in the currently selected environment: "pip install pyodbc" or "pip3 install pyodbc"
Check the installation package. "pip list":
Run:
More: Environment in VSCode.
If you are using the python extension to run you files. Then you are using python in a virtual envirnment to run python and not the system python. so even if you installed a package, as long as you did not install it in the venv python vs code won't find it.
To test this run your .py file from the command line and see if you get the same error.
if you don't then reconfigure you python interpreter in vs code or install the package in the vnev.
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've hit a snag using Jupyter notebook in Anaconda on a Mac. My setup is:
MacOS Catalina 10.15.3 (default shell zsh)
Anaconda-Navigator 1.9.12
Jupyter-client 5.3.4
Jupyter-console 6.1.0
Jupyter-core 4..1
Basically, I have some Python code to extract some text from an old Word document. The code uses the textract library (https://textract.readthedocs.io/en/latest/index.html). Unfortunaltey, this library is not included in Anaconda and it has some other dependencies, most notably in this case a library called antiword.
The steps I've taken so far:
Installed Mac Ports and used it to install several packages (e.g. poppler, antiword, unrtf, tesseract, swig). Installation appeared to be successful. The directories /opt/local and /opt/local/bin (which is where the above binaries are located) were added to $PATH with no problems.
Created an environment (myenv) in Anaconda using Python 3.8. Added various libraries including jupyter.
Opened a Terminal with myenv activated. Installed textract using:
% pip install textract
This all seemed to work fine and there were no error messages.
Now, if I open myenv with Python or with iPython from the Anaconda-Navigator app, a terminal window opens and I can run the following commands:
>>> import textract
>>> myText = textract.process('path-to-doc-file')
>>> print(myText)
The output from the last command, as expected, is all the text contained in the Word document. This supports the idea that all the necessary libraries and dependencies have been installed correctly.
If I open myenv environment using Jupyter Notebook from the Anaconda-Navigator app, a web page appears and I can create a new notebook. However, if I try to run exactly the same commands in a cell of the notebook, I get the following errors:
FileNotFoundError: [Errno 2] No such file or directory: 'antiword'
The command `antiword path-to-file.doc` failed because the executable `antiword` is not installed on your system. Please make sure the appropriate dependencies are installed before using textract
I was surprised because I thought the Python used in the Terminal and in the Jupyter Notebook were essentially the same. And yet, that doesn't seem to be the case in this situation.
Am I missing a crucial setup step?
I have just downloaded and installed the latest version of Python on my Windows 7 machine.
Python 2.7.3
Now I want to install a Twitter library I found online:
However when I try to run easy_install tweepy, I get this error message:
'easy_install' is not recognized as an in internal or external
command, operable program or batch file.
Python has already been placed into my path, as I can invoke the Python program into the command line.
Here is a screenshot of my folder where Python is installed.
And inside the Tools folder:
And inside the scripts folder:
You need to:
Install easy_install: http://pypi.python.org/pypi/setuptools
Add C:\Python27\Scripts to your PATH
I had the same issue with Python 3.4. Fixed it with the steps below:
cd C:\Python34\Scripts
.\easy_install pip
(or what you need to install)
with the .\ you sort of grant admin permissions to the command
I think that you should set the 'PATH' variable in order to execute it
Looks like easy-install is not itself installed on your system.
See this previous question for instructions on installing.
Basics official python packages need to be installed
You can install packages via the command line by entering:
python -m pip install --user numpy scipy matplotlib ipython jupyter pandas sympy nose
0.Install easy_install
1.search for "edit the system environment variables" in search.
2.click environment variables.
3.under "system variables" click "path" and click edit.
4.click "new".
5.go back and copy the path where python package(easy_install) is installed and paste it there.
6.click ok everything.
7.check now it works...