Created
August 1, 2013 14:14
-
-
Save dpshelio/6131758 to your computer and use it in GitHub Desktop.
Astropy import error from a web application.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/usr/local/lib/python2.7/dist-packages/astropy/config/configuration.py:432: ConfigurationMissingWarning: Configuration defaults will be used, and configuration cannot be saved due to OSError:Could not find unix home directory to search for astropy config dir | |
warn(ConfigurationMissingWarning(msg)) | |
/usr/local/lib/python2.7/dist-packages/astropy/logger.py:490: RuntimeWarning: log file '' could not be opened for writing: Could not find unix home directory to search for astropy config dir | |
'{1}'.format(log_file_path, unicode(e)), RuntimeWarning) | |
Traceback (most recent call last): | |
File "testastropy.py", line 2, in <module> | |
import astropy | |
File "/usr/local/lib/python2.7/dist-packages/astropy/__init__.py", line 153, in <module> | |
config.configuration.update_default_config(__package__, config_dir) | |
File "/usr/local/lib/python2.7/dist-packages/astropy/config/configuration.py", line 688, in update_default_config | |
if os.path.exists(cfgfn): | |
File "/usr/lib/python2.7/genericpath.py", line 18, in exists | |
os.stat(path) | |
TypeError: coercing to Unicode: need string or buffer, NoneType found |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import astropy | |
result = {'version': astropy.__version__} | |
print json.dumps(result) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$result = shell_exec('python testastropy.py'); | |
$resultData = json_decode($result, true); | |
var_dump($resultData); | |
?> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment