Fatal error in launcher: Unable to creat process using "c:\bld\scrapy_345323\_h_env\python.exe" - scrapy

I installed anaconda and python on Windows 7 without errors.
I tried to run an example from scrapy.org.
scrapy runspider quotes_spider.py -o quotes.json
I got an error:
Fatal error in launcher: Unable to creat process using “c:\bld\scrapy_345323_h_env\python.exe”
How can I resolve this?

Well for anyone that would like to create his first bot from scrapy.org I can confirm the solution is as follows:
first uninstall scrapy from conda
conda uninstall -c conda-forge scrapy
and use pip instead as follows:
pip install --force-reinstall scrapy
I had an astroid 2.2.5 problem, but reinstallation succedeed
and I ran the script succesfully
scrapy runspider quotes_spider.py -o quotes.json
Anyway you may experience other problems running the example provided quotes_spider.py, then I suggest trying locating your spider .py to the same folder as your anaconda prompt (in my case,c:\users\bla bla)
running the anaconda powershell did not work anymore, so I will continue working from anaconda prompt

Related

Tensorflow-Text in Miniconda

I am trying to install tensorflow-text through miniconda in Spyder. I have managed to install other modules in Spyder such as tensorflow itself, pandas, scikit-learn, etc. However, using the same command as all the other installations (with the specific package name replaced by tensorflow-text)
conda install spyder-kernels tensorflow-text -y
I continue to get the same error whenever I try to install tensorflow-text:
PackagesNotFoundError: The following packages are not available from current channels:
- tensorflow-text
followed by a suggestion to search for the package on anaconda.org. As such, I searched for the tensorflow-text package on the anaconda site and found one, albeit for linux, by rocketce. Attempting to run the commands listed under the tensorflow-text installation instructions on that webpage also yielded the same error.
At first, I tried to install tensorflow-text through pip and was able to successfully run the command
pip install -U tensorflow-text==2.10.0
which seemed to install tensorflow-text. But I could not figure out how to access it or if it was correctly installed. Specifically, I am looking to use tensorflow-text in the Spyder IDE. I was able to get tensorflow working in the IDE, but not the specific tensorflow-text.
I am using a Windows 10 system; I could not find anything on the anaconda site for Windows 10. I am rather inexperienced (if you could not already tell from the nature and description of the problem), so patience and clear explanations are appreciated. Thanks in advance!

Issue while installing Tensorflow via Jupyter Notebook

WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.
Please see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue.
To avoid this problem you can invoke Python with '-m pip' instead of running pip directly.
ERROR: Could not install packages due to an EnvironmentError: [WinError 5] Access is denied: 'c:\\programdata\\anaconda3\\lib\\site-packages\\~-mpy\\core\\multiarray.cp37-win_amd64.pyd'
Consider using the `--user` option or check the permissions.
Although when I tried python -m pip install tensorflow in command prompt it installed the packagen, when I am trying to import Keras in Jupyter notebook I am getting above error.
It looks like you are on Windows. Open your command prompt as administrator and then type python -m pip install tensorflow --user. Let me know if this fixed your issue.

tensor flow install problems [duplicate]

I'm trying to use pip to install a package. I try to run pip install from the Python shell, but I get a SyntaxError. Why do I get this error? How do I use pip to install the package?
>>> pip install selenium
^
SyntaxError: invalid syntax
pip is run from the command line, not the Python interpreter. It is a program that installs modules, so you can use them from Python. Once you have installed the module, then you can open the Python shell and do import selenium.
The Python shell is not a command line, it is an interactive interpreter. You type Python code into it, not commands.
Use the command line, not the Python shell (DOS, PowerShell in Windows).
C:\Program Files\Python2.7\Scripts> pip install XYZ
If you installed Python into your PATH using the latest installers, you don't need to be in that folder to run pip
Terminal in Mac or Linux
$ pip install XYZ
As #sinoroc suggested correct way of installing a package via pip is using separate process since pip may cause closing a thread or may require a restart of interpreter to load new installed package so this is the right way of using the API: subprocess.check_call([sys.executable, '-m', 'pip', 'install', 'SomeProject']) but since Python allows to access internal API and you know what you're using the API for you may want to use internal API anyway eg. if you're building own GUI package manager with alternative resourcess like https://www.lfd.uci.edu/~gohlke/pythonlibs/
Following soulution is OUT OF DATE, instead of downvoting suggest updates. see https://github.com/pypa/pip/issues/7498 for reference.
UPDATE: Since pip version 10.x there is no more get_installed_distributions() or main method under import pip instead use import pip._internal as pip.
UPDATE ca. v.18 get_installed_distributions() has been removed. Instead you may use generator freeze like this:
from pip._internal.operations.freeze import freeze
print([package for package in freeze()])
# eg output ['pip==19.0.3']
If you want to use pip inside the Python interpreter, try this:
import pip
package_names=['selenium', 'requests'] #packages to install
pip.main(['install'] + package_names + ['--upgrade'])
# --upgrade to install or update existing packages
If you need to update every installed package, use following:
import pip
for i in pip.get_installed_distributions():
pip.main(['install', i.key, '--upgrade'])
If you want to stop installing other packages if any installation fails, use it in one single pip.main([]) call:
import pip
package_names = [i.key for i in pip.get_installed_distributions()]
pip.main(['install'] + package_names + ['--upgrade'])
Note: When you install from list in file with -r / --requirement parameter you do NOT need open() function.
pip.main(['install', '-r', 'filename'])
Warning: Some parameters as simple --help may cause python interpreter to stop.
Curiosity: By using pip.exe you actually use python interpreter and pip module anyway. If you unpack pip.exe or pip3.exe regardless it's python 2.x or 3.x, inside is the SAME single file __main__.py:
# -*- coding: utf-8 -*-
import re
import sys
from pip import main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
sys.exit(main())
To run pip in Python 3.x, just follow the instructions on Python's page: Installing Python Modules.
python -m pip install SomePackage
Note that this is run from the command line and not the python shell (the reason for syntax error in the original question).
I installed python and when I run pip command it used to throw me an error like shown in pic below.
Make Sure pip path is added in environmental variables. For me, the python and pip installation path is::
Python: C:\Users\fhhz\AppData\Local\Programs\Python\Python38\
pip: C:\Users\fhhz\AppData\Local\Programs\Python\Python38\Scripts
Both these paths were added to path in environmental variables.
Now Open a new cmd window and type pip, you should be seeing a screen as below.
Now type pip install <<package-name>>. Here I'm installing package spyder so my command line statement will be as pip install spyder and here goes my running screen..
and I hope we are done with this!!
you need to type it in cmd not in the IDLE. becuse IDLE is not an command prompt if you want to install something from IDLE type this
>>>from pip.__main__ import _main as main
>>>main(#args splitted by space in list example:['install', 'requests'])
this is calling pip like pip <commands> in terminal. The commands will be seperated by spaces that you are doing there to.
If you are doing it from command line,
try -
python -m pip install selenium
or (for Python3 and above)
python3 -m pip install selenium

Installing PyQt5 from sources: Unable to import PyQt5.sip

I'm trying to build PyQt5 from the sources. I'm running fedora 28 and I installed Qt5 via dnf. Installing Sip following this seems OK. But when i try to configure PyQt i got this error:
# python3 configure.py -q /usr/bin/qmake-qt5
Querying qmake about your Qt installation...
Error: Unable to import PyQt5.sip. Make sure you have configured SIP to
create a private copy of the sip module.
According to the doc I did:
# python3 configure.py --sip-module private.sip
# python3 configure.py -q /usr/bin/qmake-qt5 -n private.sip
But i still get the error. So I'm guessing I'm not using it properly. Any suggestions ?
P.S: I know (and i did) that it can be done via pip but i'm facing the same problem than here
Are you trying to install sip-4.19.10 and PyQt5_gpl-5.11.1?
Try a combination of sip-4.19.8 and PyQt5_gpl-5.10.1.
https://sourceforge.net/projects/pyqt/files/PyQt5/
https://sourceforge.net/projects/pyqt/files/sip/

Error attempting to install scrapy using easy_install osx 10.8

(Newbie here) I've been attempting to install scrapy using easy_install, but get the following error:
Ben$ easy_install -U Scrapy
Searching for Scrapy
Reading http://pypi.python.org/simple/Scrapy/
Reading http://scrapy.org
Best match: Scrapy 0.14.4
Processing Scrapy-0.14.4-py2.7.egg
Scrapy 0.14.4 is already the active version in easy-install.pth
Installing scrapy script to /Library/Frameworks/Python.framework/Versions/2.7/bin
Using /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Scrapy-0.14.4-py2.7.egg
Processing dependencies for Scrapy
Searching for lxml
Reading http://pypi.python.org/simple/lxml/
Reading http://codespeak.net/lxml
Best match: lxml 2.3.6
Downloading http://lxml.de/files/lxml-2.3.6.tgz
Processing lxml-2.3.6.tgz
Running lxml-2.3.6/setup.py -q bdist_egg --dist-dir /var/folders/j1/l3w7_q554b3fkk3xyw_998nc0000gn/T/easy_install-w5NqEl/lxml-2.3.6/egg-dist-tmp-6MyEeO
Building lxml version 2.3.6.
Building without Cython.
Using build configuration of libxslt 1.1.26
unable to execute gcc-4.0: No such file or directory
error: Setup script exited with error: command 'gcc-4.0' failed with exit status 1
Any idea what I am missing here?
Thanks
Install GCC first; easiest way is via https://github.com/kennethreitz/osx-gcc-installer .
After installing GCC, run easy_install again.