I am installing spark 1.2.1 on windows 8 and I have downloaded a prebuilt package for Hadoop 2.4
When i am running pyspark i am getting the following error:
C:\Users\Dinesh\Desktop\spark-1.2.1-bin-hadoop2.4>bin\pyspark
Running python with PYTHONPATH=C:\Users\Dinesh\Desktop\spark-1.2.1-bin-hadoop2.4\bin\..\python\lib\py4j-0.8.2.1-src.zip;C:\Users\Dinesh\Desktop\spark-1.2.1-bin-hadoop2.4\bin\..\python;
Python 2.7.6 (default, Nov 10 2013, 19:24:18) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
The system cannot find the path specified.
Traceback (most recent call last):
File "C:\Users\Dinesh\Desktop\spark-1.2.1-bin-Hadoop2.4\bin\..\python\pyspark\shell.py", line 45, in <module>
sc = SparkContext(appName="PySparkShell", pyFiles=add_files)
File "C:\Users\Dinesh\Desktop\spark-1.2.1-bin-hadoop2.4\python\pyspark\context.py", line 102, in __init__
SparkContext._ensure_initialized(self, gateway=gateway)
File "C:\Users\Dinesh\Desktop\spark-1.2.1-bin-hadoop2.4\python\pyspark\context.py", line 212, in _ensure_initialized
SparkContext._gateway = gateway or launch_gateway()
File "C:\Users\Dinesh\Desktop\spark-1.2.1-bin-hadoop2.4\python\pyspark\java_gateway.py", line 73, in launch_gateway
raise Exception(error_msg)
Exception: Launching GatewayServer failed with exit code 1!
Warning: Expected GatewayServer to output a port, but found no output.
I have searched and i got that in general the error is caused as the path variable are not correctly defined,but i have checked and my variable are all in place. How can i solve the error?
"The system cannot find the path specified." Which path is it talking about.?
In my case the problem came from the terminal I was using. On Git Bash on Windows I was getting the error : line 96: CMD: bad array subscript when executing spark-shell, but when I tried on PowerShell it worked fine.
The way I debugged this issue was to rem the "#echo off" command on all the command files that got called by pyspark.cmd.
In the end I nailed it down to me having JAVA_HOME set to "C:\ProgramData\Oracle\Java\javapath" which is wrong as one of the cmd scripts adds a "\bin" to JAVA_HOME before calling java.exe and it was triggering the "The system cannot find the path specified." error.
So I changed JAVA_HOME to "C:\Program Files\Java\jdk1.8.0_25" and it worked fine.
Now I have to un-rem the "#echo off"s. Hope it helps!
It maybe caused by cygwin in the DOS classpath. Spark uses the find command in the file 'spark-class2.cmd', which used then the cygwin find command instead of the DOS find command, which works somewhat different. I removed cygwin from the DOS PATH, which solved the problem.
Related
Whenever I try to run python, I get this error relating to my path.
FrankieMacBook-Pro-2~$ python
Error processing line 2 of /Users/Frankie/Library/Python/2.7/lib/python/site-packages/homebrew.pth:
Traceback (most recent call last):
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site.py", line 152, in addpackage
exec line
File "<string>", line 1
import site; site.addsitedir("/usr/local/lib/python2.7/site-packages") mkdir -p /Users/Frankie/Library/Python/2.7/lib/python/site-packages
^
SyntaxError: invalid syntax
Remainder of file ignored
Python 2.7.10 (default, Oct 23 2015, 19:19:21)
[GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.0.59.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
I've been using Python3 which doesn't have this issue for me, but now I have a task where I need to use Python2, so need to face this issue.
Any ideas what my issue is?
Did I somehow screw up my path with homebrew?
Your problem is that the Python interpreter runs site.py on startup. It is importing homebrew.pth and the copy of this file in your 2.7 installation is mangled.
Find this file and either delete it or use a text editor to take this code
mkdir -p /Users/Frankie/Library/Python/2.7/lib/python/site-packages
out of the line that begins
import site; site.addsitedir("/usr/local/lib/python2.7/site-packages")
If you get further syntax errors after doing this, look at the ^ in the syntax error message. It will point to anything else the interpreter does not like.
My computer's OS is 64-bit win 10. Python 2.7, 32-bit.
My code is plot.py, simple as below:
import matplotlib.pyplot as plt
import FileDialog
plt.plot([1,2,3,4])
plt.ylabel('some numbers')
plt.show()
When I execute pyinstaller -F plot.py, the generated
plot.exe works as expected on my current computer. However, I get an error if I try to run it on a different 32-bit Windows 7 computer:
Traceback (most recent call last):
File "site-packages\GUI_tempCtrl\plot.py", line 3, in <module>
File "lib\site-packages\matplotlib\pyplot.py", line 3147, in plot
File "lib\site-packages\matplotlib\pyplot.py", line 928, in gca
File "lib\site-packages\matplotlib\pyplot.py", line 578, in gcf
File "lib\site-packages\matplotlib\pyplot.py", line 527, in figure
File "lib\site-packages\matplotlib\backends\backend_tkagg.py", line 84, in new
_figure_manager
File "lib\site-packages\matplotlib\backends\backend_tkagg.py", line 92, in new
_figure_manager_given_figure
File "lib\lib-tk\Tkinter.py", line 1814, in __init__
_tkinter.TclError: Can't find a usable init.tcl in the following directories:
C:/Users/ADMINI~1/AppData/Local/Temp/lib/tcl8.5 C:/Users/Administrator/lib/t
cl8.5 C:/Users/lib/tcl8.5 C:/Users/Administrator/library C:/Users/library C:/Use
rs/tcl8.5.15/library C:/tcl8.5.15/library
This probably means that Tcl wasn't installed properly.
Failed to execute script plot
You can try downgrading pyinstaller to v3.1 and rebuilding your exe file on your first computer to solve this issue.
Alternatively, you can fix it on your second computer by setting the TCL_LIBRARY environment variable to C:\Python27\tcl\tcl8.5\ (or wherever tcl8.5 is located)
PyInstaller has a known issue with Tkinter applications on Windows 7 and Windows XP.
Since this issue has gone unfixed for two years, I've gone ahead and started a bounty. Until the issue is fixed, there are a few workarounds you can try:
Workaround 1 - Manually copy missing files
As mentioned in a related issue, you can manually copy the missing files from your local Python installation.
Find your local Python installation. (%LocalAppData%\Programs\Python)
Make a copy of the missing folder (...\Python36-32\tcl\<missing_folder>)
Move the copy to your application's tcl folder (...\dist\<app_name>\tcl\<missing_folder>)
Workaround 2 - Run with --onefile
Running PyInstaller in --onefile mode seems to avoid this issue.
However, note that running in single file mode will increase startup time.
Workaround 3 - Downgrade to PyInstaller 3.1.0
pip install pyinstaller==3.1.0
According to ugoertz, downgrading to PyInstaller 3.1.0 resolved the issue.
Downgrading to 3.1.0 (and also downgrading setuptools to 19.2 because of the problem described in #1941) fixed the issue for me.
Trying to install uwsgi according to documentation. I'm getting the below error on Windows 7.
What should I do?
(uwsgi-tutorial) C:\Users\Home\Videos\uwsgi-tutorial\mysite>pip install uwsgi
Collecting uwsgi
Using cached uwsgi-2.0.11.1.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 20, in <module>
File "c:\users\home\appdata\local\temp\pip-build-04g1m6\uwsgi\setup.py", line 3, in <module>
import uwsgiconfig as uc
File "uwsgiconfig.py", line 8, in <module>
uwsgi_os = os.uname()[0]
AttributeError: 'module' object has no attribute 'uname'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in c:\users\home\appdata\local\temp\pip-build-04g1m6\uwsgi
uWSGI can be compiled on Windows only using cygwin. There is no such thing as uname in normal Windows console, but it exists inside cygwin. If you're already in cygwin console, try to run uname command, if that exists, check if os.uname() in python inside cygwin is also working.
Latest news from the front, uWSGI perfectly works on Windows 10 in bash on Ubuntu on Windows
As Linux subsystem still in beta, i'd not recommend for production usage, however this will cover all dev needs.
P.S. i know that op ask about Windows 7, however as Windows 10 and Linux subsystem come to Windows world later, i think i can leave this here.
uWSGI can be compiled on Windows using Cygwin. But unfortunately, I was getting the same message with the Cygwin.
Here I am sharing the other way to install uWSGI on windows.
Step 1: Download the stable release and extract the tar file
Step 2: Open uwsgiconfig.py and import platform then replace os.uname()[index] with platform.uname()[index]
Change
uwsgi_os = os.uname()[0]
uwsgi_os_k = re.split('[-+_]', os.uname()[2])[0]
uwsgi_os_v = os.uname()[3]
uwsgi_cpu = os.uname()[4]
To
import platform
uwsgi_os = platform.uname()[0]
uwsgi_os_k = re.split('[-+_]', platform.uname()[2])[0]
uwsgi_os_v = platform.uname()[3]
uwsgi_cpu = platform.uname()[4]
Step 3: Run python setup.py install
Note: You may need to install GCC and configure it.
I installed python-magic (0.4.6) on my Win 7 64bit using pip.
I then installed cygwin 1.7.33-2 to provide the needed dlls and created a copy of cygmagic-1.dll named magic1.dll (see
When I run the Python 2.7.6 32bit shell, the "import magic" works fine.
However, a
magic.from_file('c:\user\username\sample.txt')
gives me a
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "c:\Python27\lib\site-packages\magic.py", line 119, in from_file
m = _get_magic_type(mime)
File "c:\Python27\lib\site-packages\magic.py", line 107, in _get_magic_type
i = instances.__dict__[mime] = Magic(mime=mime)
File "c:\Python27\lib\site-packages\magic.py", line 55, in __init__
self.cookie = magic_open(flags)
WindowsError: exception: access violation writing 0x00000000
Any ideas what causes the this error and how I can fix it?
Thank you for your help!
The GnuWin32 file package has a 32-bit magic1.dll, along with its dependencies regex2.dll and zlib1.dll. I know from testing that this version works with python-magic. Here's an overview of the steps that I took to test this in 32-bit Python 3.3.
Extract the files to GnuWin32's installation directory:
C:\Temp>set "GNU=C:\Program Files (x86)\GNU"
C:\Temp>7z x -y -o"%GNU%" file-5.03-bin.zip > nul
C:\Temp>7z x -y -o"%GNU%" file-5.03-dep.zip > nul
Set up the environment to find the DLLs and magic file:
C:\Temp>set PATH=%PATH%;%GNU%\bin
C:\Temp>set MAGIC=%GNU%\share\misc\magic
Install python-magic:
C:\Temp>py -3.3-32 -m pip install python-magic
Collecting python-magic
Downloading python-magic-0.4.6.tar.gz
Installing collected packages: python-magic
Running setup.py install for python-magic
Successfully installed python-magic-0.4.6
Verify that it works:
C:\Temp>py -3.3-32
Python 3.3.5 (v3.3.5:62cf4e77f785, Mar 9 2014, 10:37:12)
[MSC v.1600 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys, magic
>>> magic.from_file(sys.executable)
b'PE32 executable for MS Windows (console) Intel 80386 32-bit'
Am having a real problem with the geodjango saving an entry.
It produces a "Error: Access Violation reading 0x???????"
The error does not indicate which file or folder it's trying to gain read/write access to.
Upon researching i found other non-django programs that also have this issue, some were fixed by turning off Vista's DEP controller, but am a bit scared to go down this route and am not even totally sure if this would fix the issue.
Any one got any ideas....?
Vista is a nightmare to work on.
Below is error output:
Python 2.5.4 (r254:67916, Dec 23 2008, 15:10:54) [MSC v.1310
Type "help", "copyright", "credits" or "license" for more in
(InteractiveConsole)
from django.contrib.gis.utils import add_postgis_srs
add_postgis_srs(900913)
from geofencing.models import FencingBorder
from django.contrib.gis.geos import Point
il = FencingBorder()
il.name = 'some place'
il.interestingness = 3
il.geometry = Point(-16.57,14.0)
Traceback (most recent call last):
File "", line 1, in
File "C:\SWsoft\Plesk\Additional\Python\lib\site-packages\
if isinstance(value, self._klass) and (str(value.geom_ty
File "C:\SWsoft\Plesk\Additional\Python\Lib\site-packages\
return capi.geos_type(self.ptr)
File "C:\SWsoft\Plesk\Additional\Python\lib\site-packages\
in call
return self.cfunc(*args)
File "C:\SWsoft\Plesk\Additional\Python\lib\site-packages\
check_string
free(result)
WindowsError: exception: access violation reading 0x03C2A964
il.geometry = Point(-16.57,14.0)
Traceback (most recent call last):
File "", line 1, in
File "C:\SWsoft\Plesk\Additional\Python\lib\site-packages\
if isinstance(value, self._klass) and (str(value.geom_ty
File "C:\SWsoft\Plesk\Additional\Python\Lib\site-packages\
return capi.geos_type(self.ptr)
File "C:\SWsoft\Plesk\Additional\Python\lib\site-packages\
in call
return self.cfunc(*args)
File "C:\SWsoft\Plesk\Additional\Python\lib\site-packages\
check_string
free(result)
WindowsError: exception: access violation reading 0x03C2A964
Right
In case anyone else ever has the issue..
The problem was following a doc referenced at:
http://code.google.com/p/geodjango-basic-apps/wiki/FOSS4GWorkshop
if you install GDAL from binary or install PostgreSQL 9.0
DO NOT reference the GDAL dll file in your settings.py.
Always go with setting the VARIABLE_DEFINITION in windows system's PATH.
The culprit was this in settings.py:
GEOS_LIBRARY_PATH='c:\geodjango\gdal\bin\geos_c_fw.dll'
You seems to have answered your own question. Thanks for the suggestion. I had a similar issue as well. I also had a line like:
GEOS_LIBRARY_PATH = r'C:\OSGeo4W\bin\geos_c.dll'
(Hijack the topic for a while. I know people have problems with finding a working geos binary distribution on windows. After several tries, seems OSGeo4W's distribution works for me. But I read on other people's blogs that some other distribution instead of OSGeo4W's works on their machines.)
So I remove this line and add C:\OSGeo4W\bin\geos_c.dll to system's PATH environment variable. After that, it works fine. So this confirms Tuscan's solution. Hopes it can help people running into the same issue.