Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

__pycache__ cotains bad .pyc files #18

Closed
onjin opened this issue Jul 24, 2014 · 4 comments
Closed

__pycache__ cotains bad .pyc files #18

onjin opened this issue Jul 24, 2014 · 4 comments

Comments

@onjin
Copy link

onjin commented Jul 24, 2014

Using buildout or easy_install with version 1.3.3 of django-rest-framework-csv does not work.

$ easy_install ./djangorestframework-csv-1.3.3.tar.gz
Processing djangorestframework-csv-1.3.3.tar.gz
Writing /tmp/easy_install-uIm5K5/djangorestframework-csv-1.3.3/setup.cfg
Running djangorestframework-csv-1.3.3/setup.py -q bdist_egg --dist-dir /tmp/easy_install-uIm5K5/djangorestframework-csv-1.3.3/egg-dist-tmp-rLRvvm
zip_safe flag not set; analyzing archive contents...
Traceback (most recent call last):
File "/home/onjin/.virtualenvs/tmp-cace28362d13d1a3/bin/easy_install", line 11, in
sys.exit(main())
File "/home/onjin/.virtualenvs/tmp-cace28362d13d1a3/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1909, in main
with_ei_usage(lambda:
File "/home/onjin/.virtualenvs/tmp-cace28362d13d1a3/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1896, in with_ei_usage
return f()
File "/home/onjin/.virtualenvs/tmp-cace28362d13d1a3/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1913, in
distclass=DistributionWithoutHelpCommands, **kw
File "/usr/lib/python2.7/distutils/core.py", line 151, in setup
dist.run_commands()
File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/home/onjin/.virtualenvs/tmp-cace28362d13d1a3/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 358, in run
self.easy_install(spec, not self.no_deps)
File "/home/onjin/.virtualenvs/tmp-cace28362d13d1a3/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 574, in easy_install
return self.install_item(None, spec, tmpdir, deps, True)
File "/home/onjin/.virtualenvs/tmp-cace28362d13d1a3/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 623, in install_item
dists = self.install_eggs(spec, download, tmpdir)
File "/home/onjin/.virtualenvs/tmp-cace28362d13d1a3/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 809, in install_eggs
return self.build_and_install(setup_script, setup_base)
File "/home/onjin/.virtualenvs/tmp-cace28362d13d1a3/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1015, in build_and_install
self.run_setup(setup_script, setup_base, args)
File "/home/onjin/.virtualenvs/tmp-cace28362d13d1a3/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1000, in run_setup
run_setup(setup_script, args)
File "/home/onjin/.virtualenvs/tmp-cace28362d13d1a3/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 50, in run_setup
lambda: execfile(
File "/home/onjin/.virtualenvs/tmp-cace28362d13d1a3/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 100, in run
return func()
File "/home/onjin/.virtualenvs/tmp-cace28362d13d1a3/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 52, in
{'file':setup_script, 'name':'main'}
File "setup.py", line 86, in
File "/usr/lib/python2.7/distutils/core.py", line 151, in setup
dist.run_commands()
File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/home/onjin/.virtualenvs/tmp-cace28362d13d1a3/local/lib/python2.7/site-packages/setuptools/command/bdist_egg.py", line 232, in run
os.path.join(archive_root,'EGG-INFO'), self.zip_safe()
File "/home/onjin/.virtualenvs/tmp-cace28362d13d1a3/local/lib/python2.7/site-packages/setuptools/command/bdist_egg.py", line 271, in zip_safe
return analyze_egg(self.bdist_dir, self.stubs)
File "/home/onjin/.virtualenvs/tmp-cace28362d13d1a3/local/lib/python2.7/site-packages/setuptools/command/bdist_egg.py", line 407, in analyze_egg
safe = scan_module(egg_dir, base, name, stubs) and safe
File "/home/onjin/.virtualenvs/tmp-cace28362d13d1a3/local/lib/python2.7/site-packages/setuptools/command/bdist_egg.py", line 438, in scan_module
code = marshal.load(f); f.close()
ValueError: bad marshal data (unknown type code)

After removing pycache folder everything works again

@Marijus
Copy link

Marijus commented Jul 29, 2014

I got the exact same problem. How did you remove pycache ?

@onjin
Copy link
Author

onjin commented Jul 29, 2014

I downloaded tar.gz from pypi, extracted, removed pycache and packed again:

wget https://pypi.python.org/packages/source/d/djangorestframework-csv/djangorestframework-csv-1.3.3.tar.gz
tar zxfv djangorestframework-csv-1.3.3.tar.gz
rm -rf djangorestframework-csv-1.3.3/rest_framework_csv/__pycache__ 
tar zcfv ./djangorestframework-csv-1.3.3.tar.gz ./djangorestframework-csv-1.3.3

and now you can use easy_install or buildout:

easy_install ./djangorestframework-csv-1.3.3.tar.gz

this is final file:

@reinout
Copy link

reinout commented May 8, 2015

@mjumbewu, can you make a new release? The 1.3.3 is un-installable because of this issue. I have the go back to 1.3.0 from a year earlier.

@mjumbewu
Copy link
Owner

Sorry that took so long everyone, but I just pushed a 1.3.4 relase to PyPI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants