how to use xlrd module with python for abaqus

2024/10/15 1:17:19

I'm working on a script for abaqus where I have to import data from an excel file to put them into my script. I already downloaded the xlrd module and it work well on python interpreter (IDLE), but when I put the line import xlrd in the script in abaqus PDE an error pop:

no module named xlrd

I think that the problem is that the xlrd module is installed, but abaqus use only default modules when it works, so I have to add the module xlrd for abaqus manually, how can I do this? I'm using python 3.5.x, should I change for an older version 2.7.x? How can I do this ?

Answer

You can add path to sys.path where it can find xlrd package.

import sys
sys.path.append('/home/harsh/.virtualenvs/abc_test/lib/python2.7/site-packages/')
import xlrd

Happy Coding.

https://en.xdnf.cn/q/117885.html

Related Q&A

Property in Python with @property.getter

I have an intresting behaviour for the following code:class MyClass:def __init__(self):self.abc = 10@propertydef age(self):return self.abc@age.getterdef age(self):return self.abc + 10@age.setterdef age…

Foreign Key Access

--------------------------------------------MODELS.PY-------------------------------------------- class Artist(models.Model):name = models.CharField("artist", max_length=50) #will display &…

ValueError: could not broadcast input array from shape (22500,3) into shape (1)

I relied on the code mentioned, here, but with minor edits. The version that I have is as follows:import numpy as np import _pickle as cPickle from PIL import Image import sys,ospixels = [] labels = []…

VGG 16/19 Slow Runtimes

When I try to get an output from the pre-trained VGG 16/19 models using Caffe with Python (both 2.7 and 3.5) its taking over 15 seconds on the net.forward() step (on my laptops CPU).I was wondering if …

Numpy vs built-in copy list

what is the difference below codesbuilt-in list code>>> a = [1,2,3,4] >>> b = a[1:3] >>> b[1] = 0 >>> a [1, 2, 3, 4] >>> b [2, 0]numpy array>>> c …

Scrapy returns only first result

Im trying to scrape data from gelbeseiten.de (yellow pages in germany)# -*- coding: utf-8 -*- import scrapyfrom scrapy.spiders import CrawlSpiderfrom scrapy.http import Requestfrom scrapy.selector impo…

Softlayer getAllBillingItems stopped working?

The following python script worked like a charm last month:Script:import SoftLayer client = SoftLayer.Client(username=someUser, api_key=someKey) LastInvoice = client[Account].getAllBillingItems() print…

Looking for a specific value in JSON file

I have a json file created by a function. The file is looks like this :{"images": [{"image": "/WATSON/VISUAL-REC/../IMAGES/OBAMA.jpg", "classifiers": [{"cla…

How to put many numpy files in one big numpy file without having memory error?

I follow this question Append multiple numpy files to one big numpy file in python in order to put many numpy files in one big file, the result is: import matplotlib.pyplot as plt import numpy as np i…

scraping : nested url data scraping

I have a website name https://www.grohe.com/in In that page i want to get one type of bathroom faucets https://www.grohe.com/in/25796/bathroom/bathroom-faucets/grandera/ In that page there are multiple…