MemoryError using CVS2SVN - python

I'm trying to migrate a CSV repository to SVN using csv2svn. After dealing with some errors during the first pass (CollectRevsPass), i'm in the fourth step and this error appears:
...
c:\Users\Andres\Desktop\copa\copa\proyectosAMEG\JGA\KnapsackJG2A\src\operators\K
napsackSelection.java,v
Done
Time for pass1 (CollectRevsPass): 68.47 seconds.
----- pass 2 (CleanMetadataPass) -----
Converting metadata to UTF8...
Done
Time for pass2 (CleanMetadataPass): 0.437 seconds.
----- pass 3 (CollateSymbolsPass) -----
Checking for forced tags with commits...
Done
Time for pass3 (CollateSymbolsPass): 0.015 seconds.
----- pass 4 (FilterSymbolsPass) -----
Filtering out excluded symbols and summarizing items...
Traceback (most recent call last):
File "C:\Users\Andres\Downloads\cvs2svn-2.4.0.tar\dist\cvs2svn-2.4.0\cvs2svn-2
.4.0\cvs2svn", line 70, in <module>
svn_main(os.path.basename(sys.argv[0]), sys.argv[1:])
File "C:\Users\Andres\Downloads\cvs2svn-2.4.0.tar\dist\cvs2svn-2.4.0\cvs2svn-2
.4.0\cvs2svn_lib\main.py", line 113, in svn_main
main(progname, run_options, pass_manager)
File "C:\Users\Andres\Downloads\cvs2svn-2.4.0.tar\dist\cvs2svn-2.4.0\cvs2svn-2
.4.0\cvs2svn_lib\main.py", line 96, in main
pass_manager.run(run_options)
File "C:\Users\Andres\Downloads\cvs2svn-2.4.0.tar\dist\cvs2svn-2.4.0\cvs2svn-2
.4.0\cvs2svn_lib\pass_manager.py", line 181, in run
the_pass.run(run_options, stats_keeper)
File "C:\Users\Andres\Downloads\cvs2svn-2.4.0.tar\dist\cvs2svn-2.4.0\cvs2svn-2
.4.0\cvs2svn_lib\passes.py", line 505, in run
revision_collector.process_file(cvs_file_items)
File "C:\Users\Andres\Downloads\cvs2svn-2.4.0.tar\dist\cvs2svn-2.4.0\cvs2svn-2
.4.0\cvs2svn_lib\checkout_internal.py", line 615, in process_file
_Sink(self, cvs_file_items),
File "C:\Users\Andres\Downloads\cvs2svn-2.4.0.tar\dist\cvs2svn-2.4.0\cvs2svn-2
.4.0\cvs2svn_lib\rcsparser.py", line 68, in parse
return selected_parser().parse(file, sink)
File "C:\Users\Andres\Downloads\cvs2svn-2.4.0.tar\dist\cvs2svn-2.4.0\cvs2svn-2
.4.0\cvs2svn_rcsparse\common.py", line 477, in parse
self.parse_rcs_deltatext()
File "C:\Users\Andres\Downloads\cvs2svn-2.4.0.tar\dist\cvs2svn-2.4.0\cvs2svn-2
.4.0\cvs2svn_rcsparse\common.py", line 450, in parse_rcs_deltatext
self.sink.set_revision_info(revision, log, text)
File "C:\Users\Andres\Downloads\cvs2svn-2.4.0.tar\dist\cvs2svn-2.4.0\cvs2svn-2
.4.0\cvs2svn_lib\checkout_internal.py", line 539, in set_revision_info
text_record, self._rcs_stream.get_text()
File "C:\Users\Andres\Downloads\cvs2svn-2.4.0.tar\dist\cvs2svn-2.4.0\cvs2svn-2
.4.0\cvs2svn_lib\checkout_internal.py", line 601, in _writeout
self._delta_db[text_record.id] = text
File "C:\Users\Andres\Downloads\cvs2svn-2.4.0.tar\dist\cvs2svn-2.4.0\cvs2svn-2
.4.0\cvs2svn_lib\indexed_database.py", line 94, in __setitem__
s = self.serializer.dumps(item)
File "C:\Users\Andres\Downloads\cvs2svn-2.4.0.tar\dist\cvs2svn-2.4.0\cvs2svn-2
.4.0\cvs2svn_lib\serializer.py", line 138, in dumps
return marshal.dumps(zlib.compress(self.wrapee.dumps(object), 9))
MemoryError
I checked and there is enough free memory, when this error appear. Just before the Error appears, the process 'python' increaces a lot the use of memory.
Does Some one know what can I do?
CVS2SVN 2.4
Python 2.7

This error can also indicate that the process has run out of virtual address space. If you are running cvs2svn in 32-bit mode, then the process only has something like 2 GiB or 4 GiB of addresses that it can use, regardless of whether the computer has free RAM. If this is the case, try running the program in 64-bit mode.
If you are already running in 64-bit mode, then try increasing RAM or swap space or running the program on a beefier computer.

Related

Python code runs in interactive prompt but not as script

I am trying to interface with an Ocean optics spectrometer using seabreeze (seabreeze) and pyseabreeze (pyseabreeze).
If I enter python from the command prompt (cmd) in windows and enter the following code line by line, it works. However, if I put it in a script (spec_test.py) and try running it from cmd.exe by using 'python spec_test.py', it will not work.
I have searched around a lot for similar problems but none seem to cover the issue I'm having. I am running Windows 7 64 bit, python 3.5.2 installed using anaconda. I also had to install pyusb and libusb to use pyseabreeze.
The code:
import seabreeze
seabreeze.use('pyseabreeze')
import seabreeze.spectrometers as sb
devs = sb.list_devices()
print(devs)
spec = sb.Spectrometer(devs[0])
print(spec.model)
and the error message I get:
[<SeaBreezeDevice USB2000PLUS:FLMS02379>]
Traceback (most recent call last):
File "C:\Users\Raman Lab\AppData\Local\Continuum\Anaconda3\lib\site-packages\seabreeze\pyseabreeze\interfaces\common.py", line 14, in decorated_func
return func(*args, **kwargs)
File "C:\Users\Raman Lab\AppData\Local\Continuum\Anaconda3\lib\site-packages\seabreeze\pyseabreeze\interfaces\spectrometer.py", line 46, in open
self.open_device(device.handle)
File "C:\Users\Raman Lab\AppData\Local\Continuum\Anaconda3\lib\site-packages\seabreeze\pyseabreeze\interfaces\communication.py", line 37, in open_device
device.set_configuration()
File "C:\Users\Raman Lab\AppData\Local\Continuum\Anaconda3\lib\site-packages\usb\core.py", line 869, in set_configuration
self._ctx.managed_set_configuration(self, configuration)
File "C:\Users\Raman Lab\AppData\Local\Continuum\Anaconda3\lib\site-packages\usb\core.py", line 102, in wrapper
return f(self, *args, **kwargs)
File "C:\Users\Raman Lab\AppData\Local\Continuum\Anaconda3\lib\site-packages\usb\core.py", line 148, in managed_set_configuration
self.backend.set_configuration(self.handle, cfg.bConfigurationValue)
File "C:\Users\Raman Lab\AppData\Local\Continuum\Anaconda3\lib\site-packages\usb\backend\libusb0.py", line 493, in set_configuration
_check(_lib.usb_set_configuration(dev_handle, config_value))
File "C:\Users\Raman Lab\AppData\Local\Continuum\Anaconda3\lib\site-packages\usb\backend\libusb0.py", line 431, in _check
raise USBError(errmsg, ret)
usb.core.USBError: [Errno None] b'libusb0-dll:err [set_configuration] could not set config 1: win error: The parameter is incorrect.\r\n'
Traceback (most recent call last):
File "<ipython-input-9-ead886eb3666>", line 1, in <module>
runfile('C:/Users/Raman Lab/Python code/Spectrometers/spec_testing.py', wdir='C:/Users/Raman Lab/Python code/Spectrometers')
File "C:\Users\Raman Lab\AppData\Local\Continuum\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 866, in runfile
execfile(filename, namespace)
File "C:\Users\Raman Lab\AppData\Local\Continuum\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 102, in execfile
exec(compile(f.read(), filename, 'exec'), namespace)
File "C:/Users/Raman Lab/Python code/Spectrometers/spec_testing.py", line 7, in <module>
spec = sb.Spectrometer(devs[0])
File "C:\Users\Raman Lab\AppData\Local\Continuum\Anaconda3\lib\site-packages\seabreeze\spectrometers.py", line 62, in __init__
self._open_device(device)
File "C:\Users\Raman Lab\AppData\Local\Continuum\Anaconda3\lib\site-packages\seabreeze\spectrometers.py", line 90, in _open_device
lib.device_open(self._dev)
File "C:\Users\Raman Lab\AppData\Local\Continuum\Anaconda3\lib\site-packages\seabreeze\pyseabreeze\wrapper.py", line 81, in device_open
return device.interface.open(device)
File "C:\Users\Raman Lab\AppData\Local\Continuum\Anaconda3\lib\site-packages\seabreeze\pyseabreeze\interfaces\common.py", line 23, in decorated_func
raise SeaBreezeError(msg)
SeaBreezeError: An error occured during opening.
Thanks for any help!
Edit:
For some reason I figured this out, thought it might help describe the issue. If I enter interactive python from cmd.exe and paste the code instead of typing it in manually, I get the same error. This makes me think (most likely I'm wrong) that it is somehow tied up with speed of imports. I tried adding a sleep for a few seconds in between lines 3 and 5, to simulate what happens when I am typing in the prompt, but that didn't help. I hope this was descriptive enough.
Your initial guess was not far off. I had exactly the same problem, however, on Windows 7 32bit with Python 2.7. The example code gchaks linked to was running fine.
When I tried executing the script several times in quick succession, the error message changed and pointed at a empty devices list. I added a delay of 2 seconds after
devs = sb.list_devices()
and that solved the problem. Your code was running just fine on a Linux machine btw.
Another hint: If your code should run once, but then you run into another error message, make sure you close the device connection or dis- and reconnect the spectrometer.

Pychecker index error on first run

I've just installed pychecker on windows 7 Pro using "python setup.py install". When I run it on my script using the command:
c:\Python26\Scripts\pychecker -#100 finaltest17.py
I get the following error/traceback:
C:\Users\....\ToBeReleased>C:\Python26\python.exe C:\Python26\Lib\site-packages\pychecker\checker.py -#100 finaltest17.py
Processing module finaltest17 (finaltest17.py)...
Caught exception importing module finaltest17:
File "C:\Python26\Lib\site-packages\pychecker\pcmodules.py", line 533, in setupMainCode()
self.moduleName, self.moduleDir)
File "C:\Python26\Lib\site-packages\pychecker\pychecker\utils.py", line 184, in findModule()
handle, filename, smt = _q_find_module(p, path)
File "C:\Python26\Lib\site-packages\pychecker\pychecker\utils.py", line 162, in _q_find_module()
if not cfg().quixote:
File "C:\Python26\Lib\site-packages\pychecker\pychecker\utils.py", line 39, in cfg()
return _cfg[-1]
IndexError: list index out of range
Traceback (most recent call last):
File "C:\Python26\Lib\site-packages\pychecker\checker.py", line 364, in <module>
sys.exit(main(sys.argv))
File "C:\Python26\Lib\site-packages\pychecker\checker.py", line 337, in main
importWarnings = processFiles(files, _cfg, _print_processing)
File "C:\Python26\Lib\site-packages\pychecker\checker.py", line 270, in processFiles
loaded = pcmodule.load()
File "C:\Python26\Lib\site-packages\pychecker\pcmodules.py", line 477, in load
return utils.cfg().ignoreImportErrors
File "C:\Python26\Lib\site-packages\pychecker\pychecker\utils.py", line 39, in cfg
return _cfg[-1]
IndexError: list index out of range
If anyone could point me in the right direction that would be great.
Thanks
Stewart
Problem resolved.
I found the following support request on SourceForge which refers to a need to use short format (8.3) path and filenames in pychecker.bat and not long format as is allowed in newer versions of Windows.
https://sourceforge.net/p/pychecker/support-requests/7/#96cb

multiprocessing in iPython: too many files open when I'm not opening any files?

I have an IPython notebook that I was running as multi-threaded and have changed over to try and run on multiple processors. There is a substantial amount of code that I won't quote here unless someone thinks it would be helpful to look at a specific portion of it. The gist of it is that I'm trying to wrap a load balancer around PyOpenCL so I need to feed multiple independent queues-- partly to solve a specific problem (particle simulation) and partly as a learning exercise.
At no point am I intentionally opening any files, yet it's crashing with this error:
Traceback (most recent call last):
File "//anaconda/lib/python3.4/site-packages/IPython/core/interactiveshell.py", line 3035, in run_code
File "<ipython-input-23-d29c87aba720>", line 1, in <module>
co.convergeStep(mags[3])
File "<ipython-input-17-0eac43f0bbbf>", line 62, in convergeStep
evt=self.nlb.qTask(evtList,(b,k),b.forces,k,out=b.forceAccum,out2=k.forceAccum,sum=True)
File "<ipython-input-13-0f26b8ae660e>", line 36, in qTask
t=StagingThread(waitlist,c,self.pool)
File "<ipython-input-10-549b980aea87>", line 7, in __init__
self.killme=mp.Event()
File "//anaconda/lib/python3.4/multiprocessing/context.py", line 91, in Event
File "//anaconda/lib/python3.4/multiprocessing/synchronize.py", line 336, in __init__
File "//anaconda/lib/python3.4/multiprocessing/context.py", line 76, in Condition
File "//anaconda/lib/python3.4/multiprocessing/synchronize.py", line 215, in __init__
File "//anaconda/lib/python3.4/multiprocessing/context.py", line 81, in Semaphore
File "//anaconda/lib/python3.4/multiprocessing/synchronize.py", line 127, in __init__
File "//anaconda/lib/python3.4/multiprocessing/synchronize.py", line 60, in
__init__ OSError: [Errno 24] Too many open files
Is there something opening files in the background that I'm not considering?
It looks like I have 11 processes spawned at the time of failure. I'm running under OS X 10.10.3, Python 3.4.3, IPython 3.1. I am not using multiprocessing.Pool (at least not intentionally). It looks like the failure is happening in Event? There are other exceptions that occur while handling this one, but they're mostly too many files errors and then some traceback failures and other things that look like they're a result of one of the above...

Memory error using sound stimuli in Psychopy

I wonder if anyone can see an error. I am running an experiment with approximately 220 trials. There are 3 auditory stimuli that I want to turn on for a variable amount of time and terminate when the 'space' is pressed (on some trials). At about trial 148 I get an error, indicating that the sound is the issue and the last line is "memory Error'
Specifically:
if self.lineRGB!=None and self.lineWidth!=0.0: Traceback (most recent
call last): File "C:\Users\freemali\Desktop\UGH_lastrun.py", line
4352, in short_stim3 = sound.Sound('C', secs=short_dur)
File "C:\Program
Files\PsychoPy2\lib\site-packages\psychopy-1.81.00-py2.7.egg\psychopy\sound.py",
line 217, in init self.setSound(value=value, secs=secs,
octave=octave) File "C:\Program
Files\PsychoPy2\lib\site-packages\psychopy-1.81.00-py2.7.egg\psychopy\sound.py",
line 135, in setSound self._setSndFromNote(value.capitalize(),
secs, octave, hamming=hamming) File "C:\Program
Files\PsychoPy2\lib\site-packages\psychopy-1.81.00-py2.7.egg\psychopy\sound.py",
line 167, in _setSndFromNote self._setSndFromFreq(thisFreq, secs,
hamming=hamming) File "C:\Program
Files\PsychoPy2\lib\site-packages\psychopy-1.81.00-py2.7.egg\psychopy\sound.py",
line 177, in _setSndFromFreq self._setSndFromArray(outArr) File
"C:\Program
Files\PsychoPy2\lib\site-packages\psychopy-1.81.00-py2.7.egg\psychopy\sound.py",
line 291, in _setSndFromArray thisArray=
(thisArray*2**15).astype(numpy.int16) MemoryError
Is this a result of Psychopy not releasing the auditory stimuli? Because I want the stimuli on for a variable period of time, I am using stimulus.stop() at the end of the routine. Is this an issue?

weird error with django-celery or python

I'm having trouble running tasks. I run ./manage celeryd -B -l info, it correctly loads all tasks to registry.
The error happens when any of the tasks run - the task starts, does its thing, and then I get:
[ERROR/MainProcess] Thread 'ResultHandler' crashed: ValueError('Octet out of range 0..2**64-1',)
Traceback (most recent call last):
File "/Users/jzelez/Sites/my_virtual_env/lib/python2.7/site-packages/celery/concurrency/processes/pool.py", line 221, in run
return self.body()
File "/Users/jzelez/Sites/my_virtual_env/lib/python2.7/site-packages/celery/concurrency/processes/pool.py", line 458, in body
on_state_change(task)
File "/Users/jzelez/Sites/my_virtual_env/lib/python2.7/site-packages/celery/concurrency/processes/pool.py", line 436, in on_state_change
state_handlers[state](*args)
File "/Users/jzelez/Sites/my_virtual_env/lib/python2.7/site-packages/celery/concurrency/processes/pool.py", line 413, in on_ack
cache[job]._ack(i, time_accepted, pid)
File "/Users/jzelez/Sites/my_virtual_env/lib/python2.7/site-packages/celery/concurrency/processes/pool.py", line 1016, in _ack
self._accept_callback(pid, time_accepted)
File "/Users/jzelez/Sites/my_virtual_env/lib/python2.7/site-packages/celery/worker/job.py", line 424, in on_accepted
self.acknowledge()
File "/Users/jzelez/Sites/my_virtual_env/lib/python2.7/site-packages/celery/worker/job.py", line 516, in acknowledge
self.on_ack()
File "/Users/jzelez/Sites/my_virtual_env/lib/python2.7/site-packages/celery/worker/consumer.py", line 405, in ack
message.ack()
File "/Users/jzelez/Sites/my_virtual_env/lib/python2.7/site-packages/kombu-2.1.0-py2.7.egg/kombu/transport/base.py", line 98, in ack
self.channel.basic_ack(self.delivery_tag)
File "/Users/jzelez/Sites/my_virtual_env/lib/python2.7/site-packages/amqplib-1.0.2-py2.7.egg/amqplib/client_0_8/channel.py", line 1740, in basic_ack
args.write_longlong(delivery_tag)
File "/Users/jzelez/Sites/my_virtual_env/lib/python2.7/site-packages/amqplib-1.0.2-py2.7.egg/amqplib/client_0_8/serialization.py", line 325, in write_longlong
raise ValueError('Octet out of range 0..2**64-1')
ValueError: Octet out of range 0..2**64-1
I also must note that this worked on my previous Lion install, and even if I create a blank virtualenv with some test code, when a task runs it gives this error.
This happens with Python 2.7.2 and 2.6.4.
Django==1.3.1
amqplib==1.0.2
celery==2.4.6
django-celery==2.4.2
It appears there is some bug with homebrew install python. I've now switched to the native Lion one (2.7.1) and it works.

Categories

Resources